Predicting and ranking possible next sentences in a narrative in an artificial grammar #9126
Replies: 1 comment 1 reply
-
Next sentence prediction is kind of like language modelling / next token prediction and is a pretty common task. There isn't anything similar in spaCy by default. You could wire up a component to do this if you have a way of getting candidate next sentences, maybe the Entity Linker would be a useful reference since it uses an external database. Basically you have an input text and your model uses features of that to select from a list of candidates somehow generated using the input text and external data (a knowledge base for entity linking, or your grammar for your case). I have absolutely no idea how that that would go together with your artificial grammar. It sounds like maybe you could model it as a neural NLG/seq2seq problem, but NLG is specifically out of scope for spaCy, and it wouldn't necessarily fit your grammar constraints anyway. If you can generate candidate sentences it should be possible to train a model to pick the best one, but I'm not sure I really know of any similar problems... |
Beta Was this translation helpful? Give feedback.
-
I'm probably pushing it with this question but hoping for the wise direction of spaCy's wonderful maintainers. Is it possible to use spaCy to predict and rank the probability of possible next sentences in an artificial grammar? The training data is a corpus of thousands of documents with sentence sequences ranging between 5 to 200 sentences. I've scoured Jurafsky & Martin and I'm wondering if this an NLP problem that I can tackle in the spaCy framework. What spaCy feature domain would that map to?
My domain of discourse is a metalanguage for labeling narratives, A corpus of thousands of narratives (documents) are labeled into sentences of an artificial grammar (using spaCy to create this meta grammar labeling). Each sentence can be described in BNF meta notation, involving about 200 entity types related through 5 semantic role relationships as arguments of 20 possible narrative function verbs. The purpose of my project is to auto-generate possible narrative paths from the previous path of narrative sentences according to a global scoring function for narrative excitement.
Beta Was this translation helpful? Give feedback.
All reactions