Skip to content

Commit

Permalink
Read in Luis regex features
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Jul 6, 2017
1 parent ee3ad35 commit 119319b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rasa_nlu/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ def load_luis_data(filename):
raise Exception("Invalid luis data schema version {}, should be 2.x.x. ".format(data["luis_schema_version"]) +
"Make sure to use the latest luis version (e.g. by downloading your data again).")

for r in data.get("regex_features", []):
if r.get("activated", False):
regex_features.append({"name": r.get("name"), "pattern": r.get("pattern")})

for s in data["utterances"]:
text = s.get("text")
intent = s.get("intent")
Expand All @@ -99,7 +103,7 @@ def load_luis_data(filename):
if intent:
data["intent"] = intent
training_examples.append(Message(text, data))
return TrainingData(training_examples)
return TrainingData(training_examples, regex_features=regex_features)


def load_wit_data(filename):
Expand Down

0 comments on commit 119319b

Please sign in to comment.