You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/explanation/postprocessing.rst
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,11 +105,11 @@ Construct names from NAME groups
105
105
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106
106
107
107
From the name groups, we construct the ingredient names.
108
-
This is more easily done by iterating in reverse over the groups and applying the following logic:
108
+
This is most easily done by iterating in reverse over the groups and applying the following logic:
109
109
110
110
* Each group starting with B_NAME_TOK forms a new name.
111
-
* Each NAME_VAR group is prepended to the beginning of the more recent name.
112
-
* Each NAME_MOD group is prepended to all previous name groups.
111
+
* Each NAME_VAR group is prepended to the beginning of the most recent name.
112
+
* Each NAME_MOD group is prepended to all previous names.
113
113
114
114
The output from this construction step are groups of indices, where each group represents an ingredient name.
115
115
@@ -125,7 +125,7 @@ For the example sentence, the constructed groups of indices are:
125
125
Create :class:`IngredientText` objects
126
126
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127
127
128
-
With the group of indices obtained from the previous step, we can convert these to token indices and then follow the steps used to post-process the SIZE, PREP, PURPOSE, COMMENT labels described above.
128
+
With the groups of indices obtained from the previous step, we can convert to token indices and then follow the steps used to post-process the SIZE, PREP, PURPOSE, COMMENT labels described above.
129
129
130
130
Once the :class:`IngredientText` objects have been obtained, we perform one final post-processing step. If there are multiple names, we check the part of speech tag for the last token in each name. If the part of speech tag is **IN**, **DT** or **JJ**, we merge the name with the next name. This merging of ingredient names is necessary to mitigate against mislabelling of tokens by the model, which can happen if a name is split by a token with another label.
0 commit comments