Implementing a custom semantics parser on spacy 3.0 #7282
-
tl;dr - Is the custom semantics parser not available on SpaCy 3.0 or am I missing a step in my data preparation steps below? Hello, I've been using the custom semantics parser that was introduced here on spacy 2.1. I tried to implement the same custom semantics parser on spacy 3.0 by converting my training set into .spacy format using Example.from_dict() with the relevant text converted into a Doc and annotations set like {'heads': [token indices], 'deps' [stuff like '-', '-', 'ROOT', '-', 'QUALITY']}. So the snippet of code looks like this:
When I run the spacy train script via CLI with the base config file I generated from
Did I miss something? Is there something more that I need to provide for the dependency parser, or is custom semantics parsing no longer available on spacy 3.0? All and any help would be appreciated. Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi, the default parser settings are set up for cases with (a lot) more data, so you can run into problems if there are just a few training examples. Here I think the main culprit is the This would probably be a useful example to convert to a new project, too. |
Beta Was this translation helpful? Give feedback.
Hi, the default parser settings are set up for cases with (a lot) more data, so you can run into problems if there are just a few training examples.
Here I think the main culprit is the
min_action_freq
cutoff. Lowering it to10
instead of30
worked for me to get this example to work with an otherwise defaultspacy init config -p parser
config. This still may not be the ideal setting for this particular toy example, but the training process could proceed.This would probably be a useful example to convert to a new project, too.