question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError when I evaluate my NER model

See original GitHub issue

Evaluation Command

!python -m rasa_nlu.test \
    --data export_data_format_train.json \
    --model model/ner_model \
    --mode evaluation

Config_file

pipeline:

  • name: “SpacyNLP”
  • name: “tokenizer_spacy”
  • name: “ner_crf”
  • name: “ner_synonyms”
  • name: “CRFEntityExtractor”

Error

/home/user/anaconda2/envs/jd_matcher/lib/python3.6/runpy.py:125: RuntimeWarning: 'rasa_nlu.test' found in sys.modules after import of package 'rasa_nlu', but prior to execution of 'rasa_nlu.test'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))

2019-04-30 11:55:12 INFO     rasa_nlu.components  - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en'.
2019-04-30 11:55:12 INFO     rasa_nlu.training_data.loading  - Training data format of export_data_format_train.json is rasa_nlu
2019-04-30 11:55:12 INFO     rasa_nlu.training_data.training_data  - Training data stats: 
	- intent examples: 0 (0 distinct intents)
	- Found intents: 
	- entity examples: 3 (9 distinct entities)
	- found entities: 'soft_skills', 'technical_skills', 'degree', 'salary', 'job_position', 'degree_major', 'job_location', 'overall_work_experience', 'technology_work_experience'

Traceback (most recent call last):
  File "/home/user/anaconda2/envs/jd_matcher/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/user/anaconda2/envs/jd_matcher/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/user/anaconda2/envs/jd_matcher/lib/python3.6/site-packages/rasa_nlu/test.py", line 1001, in <module>
    main()
  File "/home/user/anaconda2/envs/jd_matcher/lib/python3.6/site-packages/rasa_nlu/test.py", line 995, in main
    cmdline_args.histogram)
  File "/home/user/anaconda2/envs/jd_matcher/lib/python3.6/site-packages/rasa_nlu/test.py", line 744, in run_evaluation
    intent_targets = [None] * test_data.training_examples
TypeError: can't multiply sequence by non-int of type 'list'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
erohmensingcommented, May 2, 2019

Sorry @Nomiluks, I should have mentioned – awesome that you have it fixed locally. I’ve implemented the change and it’ll be released in rasa_nlu 0.15.1, so whenever that comes out, don’t be afraid of updating and losing your local fix 🙂

1reaction
erohmensingcommented, May 2, 2019

Hi @Nomiluks , what happened to your entity examples? Earlier you had this:

2019-04-30 11:55:12 INFO     rasa_nlu.training_data.training_data  - Training data stats: 
	- intent examples: 0 (0 distinct intents)
	- Found intents: 
	- entity examples: 3 (9 distinct entities)
	- found entities: 'soft_skills', 'technical_skills', 'degree', 'salary', 'job_position', 'degree_major', 'job_location', 'overall_work_experience', 'technology_work_experience'

Now it says there are no entity examples. I think that has something to do with the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to evaluate trained spaCy version 3 model?
Where test.spacy is your test data. Also, about this error: TypeError: [E978] The Tokenizer.score method takes a list of Example objects, ...
Read more >
What to do when you get an error - Hugging Face Course
In this section we'll look at some common errors that can occur when you're trying to generate predictions from your freshly tuned Transformer...
Read more >
Saving a trained NER model as a loadable module - spacy
This error likely means that your model's meta.json includes an unknown pipeline component, and spaCy fails to resolve the string name (e.g. ' ......
Read more >
Language Processing Pipelines · spaCy Usage Documentation
spaCy is a free open-source library for Natural Language Processing in Python. It features NER, POS tagging, dependency parsing, word vectors and more....
Read more >
A better way to evaluate Named Entity Recognition (NER ...
You are left guessing whether the model is suffering due to long sentence length, or is it because there are too many (or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found