Skip to content
This repository has been archived by the owner on Aug 30, 2020. It is now read-only.

Commit

Permalink
Fix first entity bug in Rasa NLU training
Browse files Browse the repository at this point in the history
  • Loading branch information
synesthesiam committed Mar 4, 2020
1 parent a96f802 commit d770679
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rhasspy/intent_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def train(self, intent_graph) -> None:
entity = None
sentence_tokens = []
entity_tokens = []
for token in intent_sent["raw_tokens"]:
for raw_token in intent_sent["raw_tokens"]:
token = raw_token
if entity and (raw_index >= entity["raw_end"]):
# Finish current entity
last_token = entity_tokens[-1]
Expand All @@ -217,7 +218,7 @@ def train(self, intent_graph) -> None:
# Add directly to sentence
sentence_tokens.append(token)

raw_index += len(token) + 1
raw_index += len(raw_token) + 1

if entity:
# Finish final entity
Expand Down

0 comments on commit d770679

Please sign in to comment.