Coder Social home page Coder Social logo

Comments (26)

koaning avatar koaning commented on May 28, 2024 1

I'll try to look into this bug tomorrow, but in the meantime -> if you're interested in submitting a diverse name-list for the UK we'd welcome any PR πŸ‘

from rasalit.

digitalWestie avatar digitalWestie commented on May 28, 2024 1

Fantastic. I'll try it out and let you know.

from rasalit.

bshivkumar15 avatar bshivkumar15 commented on May 28, 2024 1

@koaning I have used the latest build but get the same error when using Spacy
Error.txt

from rasalit.

koaning avatar koaning commented on May 28, 2024

Interesting!

From what paths are you running this? If your root has a file named custom_components.py that contains a class SimpleNameExtractorI think it should work. Could you confirm the paths? Just want to check that before I start investigating.

Also, and this is more of a curiosity, what does your SimpleNameExtractor component do?

from rasalit.

digitalWestie avatar digitalWestie commented on May 28, 2024

I'm running this in my project folder where I have a custom_components.py. The SimpleNameExtractor class has some unsophisticated code to extract names from an utterance e.g. 'My name is X' and so on.

Just to test, I copied custom_components.py into the rasalit lib folder , using:
sudo cp custom_components.py /usr/local/lib/python3.6/dist-packages/rasalit/apps/livenlu/

This isn't a great solution, but it works for now! It would be good to know if there's another way I can point it.

from rasalit.

digitalWestie avatar digitalWestie commented on May 28, 2024

Now I'm getting this error in place: InvalidModelError: Model 'en_core_web_sm' is not a linked spaCy model. Please download and/or link a spaCy model, e.g. by running: python -m spacy download en_core_web_md python -m spacy link en_core_web_md en

any chance it's related? I've tried following the advice.

from rasalit.

digitalWestie avatar digitalWestie commented on May 28, 2024

Ah, I see it asks for en_core_web_sm and it recommends downloading and linking en_core_web_md instead. I've now gone for

python -m spacy download en_core_web_sm; python -m spacy link en_core_web_sm en

I've overcome that error, and it appears to have helped.

I can provide input to Text Input for Model - but I always get this now:

TypeError: 'NoneType' object is not callable
Traceback:
File "/usr/local/lib/python3.6/dist-packages/streamlit/script_runner.py", line 332, in _run_script
    exec(code, module.__dict__)
File "/usr/local/lib/python3.6/dist-packages/rasalit/apps/livenlu/app.py", line 32, in <module>
    interpreter=interpreter, text_input=text_input
File "/usr/local/lib/python3.6/dist-packages/rasalit/apps/livenlu/common.py", line 29, in fetch_info_from_message
    element.process(msg)
File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/extractors/spacy_entity_extractor.py", line 33, in process
    doc = spacy_nlp(message.get(TEXT))

from rasalit.

koaning avatar koaning commented on May 28, 2024

Could you share your spaCy version, just in case? I'm wondering if you're using spaCy-nightly, which we currently don't support yet.

from rasalit.

koaning avatar koaning commented on May 28, 2024

@digitalWestie just to mention, we're collecting namelists for your name detection use-case over at rasa nlu examples. I'll also add a new component there that will be able to do string matching like you are, but in an optimised fashion using flashtext.

from rasalit.

digitalWestie avatar digitalWestie commented on May 28, 2024

Nope, pip says I'm using spaCy 2.3.4

Interesting you mention the names, we could easily put together a UK-centric list using the Babies First Names' datasets offered by National Records - https://www.nrscotland.gov.uk/statistics-and-data/statistics/statistics-by-theme/vital-events/names/babies-first-names

from rasalit.

koaning avatar koaning commented on May 28, 2024

Interesting. I'm also getting the same error.

File "/Users/vincent/Development/rasalit/venv/lib/python3.7/site-packages/streamlit/script_runner.py", line 324, in _run_script
    exec(code, module.__dict__)
File "/Users/vincent/Development/rasalit/rasalit/apps/livenlu/app.py", line 32, in <module>
    interpreter=interpreter, text_input=text_input
File "/Users/vincent/Development/rasalit/rasalit/apps/livenlu/common.py", line 29, in fetch_info_from_message
    element.process(msg)
File "/Users/vincent/Development/rasalit/venv/lib/python3.7/site-packages/rasa/nlu/extractors/spacy_entity_extractor.py", line 33, in process
    doc = spacy_nlp(message.get(TEXT))

Will investigate. Removing the SpacyEntityExtractor makes everything work again, but I'm curious to find out if there's a bug on Rasa's side or on the side of this repo.

from rasalit.

koaning avatar koaning commented on May 28, 2024

It's on this side because I seem to be able to run;

> rasa shell nlu
hello my name is George

{
...
"entities": [
    {
      "entity": "PERSON",
      "value": "George",
      "start": 17,
      "confidence": null,
      "end": 23,
      "extractor": "SpacyEntityExtractor"
    }
  ]
}

from rasalit.

koaning avatar koaning commented on May 28, 2024

Working on a solution #29

from rasalit.

koaning avatar koaning commented on May 28, 2024

@digitalWestie I think I've merged a fix now. Let me know if it doesn't work and I'll gladly re-open the issue.

from rasalit.

digitalWestie avatar digitalWestie commented on May 28, 2024

Working great! Thanks for this πŸ‘ πŸ₯‡

from rasalit.

koaning avatar koaning commented on May 28, 2024

@bshivkumar15 could you share the entire traceback? It indeed seems like something is happening over at the spaCy interface, but the actual error itself doesn't seem to be listed. Also, could you share your config.yml? Are you using a custom spaCy model here? Could you also share your spaCy version as well as the output of rasa --version?

from rasalit.

bshivkumar15 avatar bshivkumar15 commented on May 28, 2024

@koaning Sharing requested details

config.txt

Rasa Version : 2.0.2
Rasa SDK Version : 2.0.0
Rasa X Version : 0.34.0
Python Version : 3.8.5
Operating System : Linux-5.8.0-41-generic-x86_64-with-glibc2.29
Python Path : /home/shiva/Documents/Shiva/venv/bin/python3

============================== Info about spaCy ==============================

spaCy version 3.0.3
Location /home/shiva/Documents/Shiva/venv/lib/python3.8/site-packages/spacy
Platform Linux-5.8.0-41-generic-x86_64-with-glibc2.29
Python version 3.8.5
Pipelines

from rasalit.

koaning avatar koaning commented on May 28, 2024

Then I think I've found the problem. You're using spaCy version 3.0.3, which isn't supported by Rasa yet. There is a pull request open for it RasaHQ/rasa#7869. For now, the simplest fix would be to explicitly add "en_core_web_md" explicitly as a spaCy model in the config. That should fix most issues.

Also, I'd still appreciate a full traceback just to confirm that this is the actual issue.

from rasalit.

bshivkumar15 avatar bshivkumar15 commented on May 28, 2024

@koaning Thanks a lot adding en_code_web_md resolved the issue.

from rasalit.

bshivkumar15 avatar bshivkumar15 commented on May 28, 2024

Rasa NLU Model Playground.txt
Rasa Spelling Playground.txt
I still end the "en" error when using other options

from rasalit.

koaning avatar koaning commented on May 28, 2024

@bshivkumar15 I'm trying to understand what is going wrong here but I require more context. You sent me two files, what's the difference between the two? Also, could you share your config.yml?

from rasalit.

bshivkumar15 avatar bshivkumar15 commented on May 28, 2024

@koaning Apologies of being vague , the attached files are output when I run the spelling and live-nlu options. The same config file works for gridresults after adding the model: "en_core_web_sm" line

config-spacy.txt

from rasalit.

koaning avatar koaning commented on May 28, 2024

Just to check something else then, since now I'm confused. Is this still an issue? You're using a spaCy version (3.0) that Rasa currently doesn't support but you seem to be able to fix it with a change to your config.yml. From my end, you're not describing an issue that is related to this library.

from rasalit.

bshivkumar15 avatar bshivkumar15 commented on May 28, 2024

@koaning

#issue -1

ModuleNotFoundError: No module named 'en' when running β€œgridresults”

issue status: RESOLVED after adding model: "en_core_web_sm" line in config.yml

#issue-2 / Issue #3

When using the modified config.yml (with model: "en_core_web_sm" line in config.yml)

Get ModuleNotFoundError: No module named 'en' when running

  • rasalit spelling
  • rasalit live-nlu

Hope this helps. if you are suggesting the issue #2/#3 is related to spacy version, I just wanted to understand if they can be fixed like #1 or is this a limitation.

from rasalit.

koaning avatar koaning commented on May 28, 2024

Just to check, after modifying the config.yml did you also retrain a new model and are you using that model in rasalit?

from rasalit.

koaning avatar koaning commented on May 28, 2024

Considering the feedback here #40 I think this issue is fixed. If not, let's start a new issue that is specific to your issue.

from rasalit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.