Re:Show HN: Subsequential Transducer for Efficient Text Rewr...
by binarymax on Wednesday July 05, 2017 @01:42PM
(#14704549)
I am not yet 100% certain so I requested full-text access to read the paper, but I can say that a naive approach to string substitution will certainly be less performant than this, and offer less flexibility in replacement complexity without significant effort.
The reason being that in a naive approach, a vocabulary of size M and a document of token size N is an O(m*n) operation in the best case - while this is claimed to be an operation of O(2n).
Re:Show HN: Subsequential Transducer for Efficient Text Rewr...
by andy_ppp on Wednesday July 05, 2017 @10:52AM
(#14702824)
I’ve wanted this specifically for terms and conditions documents for a long while... any thoughts on it’s applicability to this subject; so many legal document sections are the same but you can’t just copy them.
Re:Show HN: Subsequential Transducer for Efficient Text Rewr...
by tyingq on Wednesday July 05, 2017 @03:28PM
(#14705417)
What would it do that some basic templating library wouldn't do?
Not knowing the specifics, I would lean toward a template library, as it would be more precise, and could account for things like changing gender, plurality, a vs an, etc, in a structured way.
Re:Show HN: Subsequential Transducer for Efficient Text Rewr...
by binarymax on Wednesday July 05, 2017 @10:16AM
(#14702549)
Interesting project. Question on this: "For any text t of length |t| the time it takes to perform a rewrite is O(|t|+|t'|) where t' denotes the resulting output string"
Wouldn't the vocabulary size fit into the order complexity? Vocabs that would be considered useful in this context tend to be quite large. Are you achieving worst case logn of search in the vocab?
Re:Show HN: Subsequential Transducer for Efficient Text Rewr...
by deniskyashif on Wednesday July 05, 2017 @10:24AM
(#14702615)
Hi, thanks! The outputs are encoded in the transitions and the states themselves, so the vocabulary size doesn't affect the search. It affects, however, the construction because for each node in the trie we have to add an outgoing transition for each distinct symbol of the input vocabulary.
The reason being that in a naive approach, a vocabulary of size M and a document of token size N is an O(m*n) operation in the best case - while this is claimed to be an operation of O(2n).
Not knowing the specifics, I would lean toward a template library, as it would be more precise, and could account for things like changing gender, plurality, a vs an, etc, in a structured way.
Wouldn't the vocabulary size fit into the order complexity? Vocabs that would be considered useful in this context tend to be quite large. Are you achieving worst case logn of search in the vocab?