python nlu_model.py
Fitting 2 folds for each of 6 candidates, totalling 12 fits
[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.
[Parallel(n_jobs=1)]: Done 12 out of 12 | elapsed: 0.0s finished
{‘intent’: {‘name’: ‘inform’, ‘confidence’: 0.8173132669403216}, ‘entities’: [], ‘intent_ranking’: [{‘name’: ‘inform’, ‘confidence’: 0.8173132669403216}, {‘name’: ‘goodbye’, ‘confidence’: 0.11850990850694815}, {‘name’: ‘greet’, ‘confidence’: 0.06417682455273013}], ‘text’: ‘I am planning my trip to Barcelona. What is the weather out there?’}
`
Here ihave trained my model with location Berlin. If the message contains Berlin, then the enitities are identified, why so?
Since we are using Spacy_md model, and i am adding a pipeline to it also, then why is the location not detcted as entities?
Ghostvv
(Vladimir Vlasov)
May 29, 2020, 9:23pm
2
why would it be detected if your data contains only Berlin?
since i am using spacy_sklearn pipeline and it has entities of locations and names, do i still need to add every location in training data?
what is the use of adding spacy_sklearn pipeline in the config file then?
Ghostvv
(Vladimir Vlasov)
June 2, 2020, 9:54am
5
do you mean SpacyEntityExtractor ? It is pretrained, you can use it, by adding to you config file
i have used that.
Below is my config.json file
{ "language": "en", "pipeline":"spacy_sklearn", "path":"./models/nlu", "data":"/data/data.json" }
even after using,its still not extracting location entity from messages.
Please help me troubleshoot my problem. Below i will attach my python file. If i am doing anything wrong, let me know.
nlu_model.py file
from rasa_nlu.training_data import load_data
from rasa_nlu.model import Trainer,Interpreter,Metadata
from rasa_nlu import config
def train_nlu(data,configuration,model_dir):
training_data=load_data(data)
trainer=Trainer(config.load(configuration))
trainer.train(training_data)
model_directory = trainer.persist(model_dir,fixed_model_name=‘weathernlu’)
def run_nlu():
interpreter=Interpreter.load("./models/nlu/default/weathernlu")
print(interpreter.parse(u"Schedule me a weather report on 12:00 PM."))
if name == ‘main ’ :
train_nlu(’./data/data.json’,‘config_spacy.json’,’./models/nlu’)
run_nlu()
Ghostvv
(Vladimir Vlasov)
June 2, 2020, 1:40pm
8
Pipeline spacy_sklearn
doesn’t have SpacyEntityExtractor
, see the list of components it is using: Choosing a Pipeline
sorry to bother but would you rather tell me what my config.json file should look like.
i have changed my config.json file to this :-
{
"language": "en",
"pipeline":"pretrained_embeddings_spacy",
"path":"./models/nlu",
"data":"/data/data.json"
}
even after doing this, it is not matching the entity in the message provided. (New York in this case)
nlu_model.py
Fitting 2 folds for each of 6 candidates, totalling 12 fits
[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.
[Parallel(n_jobs=1)]: Done 12 out of 12 | elapsed: 0.1s finished
{'intent': {'name': 'inform', 'confidence': 0.9289064455736472}, 'entities': [], 'intent_ranking':
[{'name': 'inform', 'confidence': 0.9289064455736472}, {'name': 'goodbye', 'confidence':
0.044456922490666}, {'name': 'greet', 'confidence': 0.026636631935686814}], 'text': 'what
is the weather in New York.'}
Ghostvv
(Vladimir Vlasov)
June 2, 2020, 6:21pm
11
here are the examples of configs: Choosing a Pipeline
you can add any component from here: Components to your config
Please read description of the components you want, some components require other components
config.yml
`pipeline:
- name: WhitespaceTokenizer
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: "char_wb"
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
- name: EntitySynonymMapper
- name: ResponseSelector`
Its showing error :
Exception: Failed to find component class for 'ResponseSelector'
Exception: Failed to find component class for 'LexicalSyntacticFeaturizer'
Exception: Failed to find component class for 'DIETClassifier'
Ghostvv
(Vladimir Vlasov)
June 3, 2020, 7:31am
13
what version are you using, please update to the latest version
i am using Rasa 1.10.2.
Still its showing that the above component is not found.
Ghostvv
(Vladimir Vlasov)
June 4, 2020, 8:34am
15
then you don’t use rasa 1.10
what? i shouldn’t use RASA?
Ghostvv
(Vladimir Vlasov)
June 4, 2020, 10:13am
17
no, I meant, that the version that you’re running is probably the older version that doesn’t have these components, you should update rasa open source to the latest version
pip install rasa
pip install rasa-nlu
i ran these commands.
How can i upgrade?
Kindly help me to the extent possible.
Ghostvv
(Vladimir Vlasov)
June 5, 2020, 8:47am
21
you don’t need rasa-nlu
anymore