Ich versuche, die Beispiel-Restaurant-Suche zu replizieren. Ich benutze es auf Windows 64/Python 3.6 Anaconda 4.4. Mein config.json sieht so aus.nicht vorhersagbar mit rasa_nlu in Python
{
"name": null,
"pipeline": ["nlp_spacy", "tokenizer_spacy", "intent_entity_featurizer_regex", "intent_featurizer_spacy", "ner_crf", "ner_synonyms", "intent_classifier_sklearn"],
"language": "en",
"num_threads": 4,
"path": "D:/rasa-nlu-working/models",
"response_log": "logs",
"config": "config.json",
"log_level": "INFO",
"port": 5000,
"data": null,
"emulate": null,
"log_file": null,
"mitie_file": "data/total_word_feature_extractor.dat",
"spacy_model_name": null,
"server_model_dirs": null,
"token": null,
"max_number_of_ngrams": 7,
"duckling_dimensions": ["time", "number", "money","ordinal","duration"],
"entity_crf_BILOU_flag": true,
"entity_crf_features": [
["low", "title", "upper", "pos", "pos2"],
["bias", "low", "word3", "word2", "upper", "title", "digit", "pos", "pos2", "pattern"],
["low", "title", "upper", "pos", "pos2"]]
}
Ich versuche zu trainieren und vorherzusagen mit Jupyter Notebook. Der Zug fährt reibungslos weiter. Wie erwartet, werden Modelle erstellt. Aber wenn ich versuche, den folgenden Code vorherzusagen.
from rasa_nlu.model import Metadata, Interpreter
# where `model_directory points to the folder the model is persisted in
interpreter = Interpreter.load('D:/rasa-nlu-working/models/model_20170904-132507', RasaNLUConfig("D:/rasa-nlu-working/config.json"))
Ich erhalte den folgenden Fehler.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-9f85d157325d> in <module>()
4
5 # where `model_directory points to the folder the model is persisted in
----> 6 interpreter = Interpreter.load('D:/rasa-nlu-working/models/model_20170904-132507', RasaNLUConfig("D:/rasa-nlu-working/config.json"))
D:\Anaconda3\lib\site-packages\rasa_nlu\model.py in load(model_metadata, config, component_builder, skip_valdation)
206 # Before instantiating the component classes, lets check if all required packages are available
207 if not skip_valdation:
--> 208 components.validate_requirements(model_metadata.pipeline)
209
210 for component_name in model_metadata.pipeline:
AttributeError: 'str' object has no attribute 'pipeline'
Aber die gleiche Konfiguration funktioniert gut, wenn ich es im HTTP-Server-Modus ausführen. Bitte helfen Sie mir bei der Lösung des Problems.
Ist 'D:/rasa-nlu-working/models/model_20170904-132507' ein Verzeichnis oder eine Datei? Es sollte Verzeichnis sein –
Es ist ein Verzeichnis. Ich habe sechs Dateien nämlich crf_model.pkl, entity_synonyms.json, intent_classifier.pkl, metadata.json, regex_featurizer.json und training_data.json. Dieser Unterordner wurde generiert, nachdem ich mit Beispieldaten trainiert habe. – Subramanian
Können Sie den Befehl posten, den Sie zum Trainieren verwenden? Kannst du auch den Inhalt von metadata.json veröffentlichen? –