Giter Club home page Giter Club logo

rasahq / rasa Goto Github PK

View Code? Open in Web Editor NEW
18.0K 350.0 4.5K 1.54 GB

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants

Home Page: https://rasa.com/docs/rasa/

License: Apache License 2.0

Python 99.30% Makefile 0.22% Dockerfile 0.22% HTML 0.06% Shell 0.10% HCL 0.09% Jinja 0.02%
nlp machine-learning machine-learning-library bot bots botkit rasa wit nlu conversational-bots

rasa's Issues

entities: list or dict?

@plauto you mentioned there was some confusion around when entities is a dict and when it's a list. Let's figure out what exactly is wrong

Why supported languages are hardcoded?

Hi all,

first of all, thank you for this awesome work!

I'm almost new to NLP & co in general, so I've started stydying as much as possible to get some grasp. Meanwhile, I've started tinkering with rasa_nlu and, after running the default provided examples, I tried to use it with italian language, but I can't specify it in the configuration file (or CLI) because it has hardcoded languages (en and de).

I'm aware it needs a total_word_feature_extractor (at least for the MITIE backend), I've generated one from a relatively small italian corpus, but I can't use it anyway on rasa_nlu.

I've also read somewhere that it's possible to avoid a predefined language model at the cost of very low quality results, but at the point where I am, it's totally acceptable.

So, is it possible (or is it planned) to support more languages and/or workaround the hardcoded languages?

Thanks in advance for the replies, keep up the good job!

further german support

we should add tests to test_tokenizers.py and test_featurizers.py that make use of spacy's german stuff.

we should also throw an error if someone tries to use mitie as a backend but has the language set to 'de'

server response

First of all, thanks for the great work!
I'm by all means no Python expert, I just wanted to try how this server works, and have encountered several issues down the road, some I could solve them, some not ... So, from the beginning:

  • numpy must be installed, maybe I missed that in the docs, but it threw error prior to install it
  • while trying to train, after installing MITIE following the steps in the docs, it won't work, at least in my setup, unless I give some extra params on the command line; the full command line I had to use is
    python -m rasa_nlu.train -c config.json -b mitie -d data/demo-rasa.json -p model
    Despite the fact mitie is configured in config.json, if I'm missing that on the command line, trainer will throw error by picking 'keyword' and saying it's not implemented. The same for the rest of the parameters.
  • after training is finished, I'm running the server as advised in the docs. Here I have two issues: I can't see the file with commands sent to the server, it's not being created, but more important, no matter what text I send for analysis, the server constantly answers like this:
    {"error": "Invalid parse parameter specified"}
    Command line is the advised one:
    curl -X POST -d '{"text":"I am looking for Chinese food"}' http://localhost:5000/parse

Can you please tell me what I'm doing wrong ? Where should I look for hints ?

Thanks a lot!

Error running sklearn backend on windows

I am getting the following error when running:

python -m rasa_nlu.server -c config.json -e api

INFO:root:using spacy + sklearn backend
Traceback (most recent call last):
  File "C:\Users\\Anaconda2\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Users\\Anaconda2\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "build\bdist.win-amd64\egg\rasa_nlu\server.py", line 247, in 
  File "build\bdist.win-amd64\egg\rasa_nlu\server.py", line 20, in __init__
  File "build\bdist.win-amd64\egg\rasa_nlu\server.py", line 54, in __create_interpreter
  File "build\bdist.win-amd64\egg\rasa_nlu\interpreters\spacy_sklearn_interpreter.py", line 15, in __init__
  File "C:\Users\\Anaconda2\lib\pickle.py", line 1384, in load
    return Unpickler(file).load()
  File "C:\Users\\Anaconda2\lib\pickle.py", line 864, in load
    dispatch[key](self)
  File "C:\Users\\Anaconda2\lib\pickle.py", line 1096, in load_global
    klass = self.find_class(module, name)
  File "C:\Users\\Anaconda2\lib\pickle.py", line 1130, in find_class
    __import__(module)
ImportError: No module named sklearn_intent_classifier

I have tried switching over to MITIE, but have had no luck getting that to work either.

I am trying to run a model that was exported from api.ai.

Any help solving this issue would be much appreciated.

Wrong language is used by spacy interpreter

Although language is set to "de" in described model (metadata.json) the interpreter still using "en" as default language.

I have fixed that by overwriting the language_name in SpacySklearnInterpreter if "language" in metadata exists.

One click button to deploy example application

We have a "deploy to Heroku" button set up, the purpose of which is to let people try out rasa NLU SUPER quickly without setting up a virtualenv, installing numpy/scipy/mitie, etc.

with the new HTTP /train endpoint, this means that users can deploy to heroku, and then just POST their downloaded data from wit/LUIS/api to train a model.

the free Heroku VPSs are very resource constrained, we only have 0.5Gb of memory to play with, see https://devcenter.heroku.com/articles/dyno-types . Running spacy will be a problem, because it's pretty memory heavy. So I think we should default to using mitie in that case.

Problem with MITIE (as of now) is that the intent classifier has really stupid line search defaults hard-coded in the C++ code. This means it can take hours to train a pretty simple model, even on a decent laptop.

My fork of MITIE has a temporary hack to disable the line search all together, which actually works fine. We just need to test that the heroku servers correctly install my fork https://github.com/amn41/MITIE and then test that we can in fact train a model in reasonable time.

The other issue is that the filesystem gets wiped regularly and without warning on heroku, so we may have to download the mitie total_word_feature_extractor.dat file any given time we train a model.

PR #31 adds functionality to persist trained models to S3, specifically so that we don't rely on the server's filesystem any more. Models should get uploaded automatically if the right environment variables are set.

Add a little more detail to the ReadTheDocs documentation

Firstly I think this is an amazing project (big thank you for the it and the blog post about the details behind it, which is well worth a read!)

I expect you've got a lot of things on the To Do list, but expanding a little on the detail in the ReadTheDocs documentation in a couple of places would help newbies a lot.

A couple of places:

  1. Installation assumes a certain amount of experience (perhaps this is a good way to avoid those with v little technical ability out as they may bring more problems, but as it stands, it doesn't list the actual steps required - you have a few lines on the ReadMe of the repo here which could be added; otherwise the only details in ReadTheDocs are for the backend choices)

  2. Some more detail on the syntax for the training data

  • it's possible to infer it from the demo file, but initially a few things weren't clear regarding what was required or not (eg you don't actually need the items in the "intent_examples" to match up to those in the "entity_examples"
  • the numbering for the start/end of entities (ie it's zero-based and the end currently needs to be one more than the expected end, eg a single character entity would typically start and end at the same position, but in the current syntax it is start+1)
  • what (if anything) is the benefit of including examples with no entities in the "entity_examples" section
  • that neither "intent_examples" nor "entiity_examples" can be empty and that for entities they are recommended to have more than one example of each case
  • whether entities can be two words or not
  • any particular formatting or names etc that won't work or causes issues
  • whether multiple files can be used in the regular Rasa format (they can be if it's working with output from API.AI)

Anyway, this isn't meant as a rude demand, just a friendly comment so it's tracked - if I get time, is this the sort of contribution you'd welcome from fellow developers/users?

visualization generates errors

$ python -m rasa_nlu.visualize ./rasa_nlu_log.json

It launch but when i do a curl, I have

Exception happened during processing of request from ('127.0.0.1', 63478)
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "build/bdist.macosx-10.12-intel/egg/rasa_nlu/visualize.py", line 14, in <lambda>
  File "build/bdist.macosx-10.12-intel/egg/rasa_nlu/visualize.py", line 27, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 655, in __init__
    self.handle()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "build/bdist.macosx-10.12-intel/egg/rasa_nlu/visualize.py", line 37, in do_GET
  File "build/bdist.macosx-10.12-intel/egg/rasa_nlu/training_data.py", line 18, in __init__
    self.fformat = self.guess_format(self.files)
  File "build/bdist.macosx-10.12-intel/egg/rasa_nlu/training_data.py", line 60, in guess_format
    if "data" in "data" and type(filedata.get("data")) is list:
AttributeError: 'list' object has no attribute 'get'

It seems that it cannot load the file but the file exists and contains:

[
  {
    "entities": {},
    "intent": "greet",
    "text": "hello"
  }
]

MITIE is always required

I tried to use the spacy backend without installing MITIE & scipy. Installing them resolved the issue.

Error message below:

python -m rasa_nlu.train -c config.json
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "build/bdist.linux-x86_64/egg/rasa_nlu/train.py", line 44, in <module>
  File "build/bdist.linux-x86_64/egg/rasa_nlu/train.py", line 36, in do_train
  File "build/bdist.linux-x86_64/egg/rasa_nlu/train.py", line 23, in create_trainer
  File "build/bdist.linux-x86_64/egg/rasa_nlu/trainers/spacy_sklearn_trainer.py", line 5, in <module>
  File "build/bdist.linux-x86_64/egg/rasa_nlu/classifiers/sklearn_intent_classifier.py", line 2, in <module>
ImportError: No module named mitie

tests for update_config

we should have some tests for the update_config method. This merges options set in the config file, passed on the command line, and set in environment variables. Should make clear to the user what takes priority and test for any conflicts.

Visualizer requires mitie but doc doesn't mention

Hello!
I was going through tutorial and attempt to visualize but got the following error. After installing MITIE, all was happy. Should we note this in the doc or am I overlooking something?

$ python -m rasa_nlu.visualize data/demo-rasa.json
192.168.200.1 - - [21/Dec/2016 21:30:12] "GET / HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('192.168.200.1', 56752)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "build/bdist.linux-x86_64/egg/rasa_nlu/visualize.py", line 14, in <lambda>
  File "build/bdist.linux-x86_64/egg/rasa_nlu/visualize.py", line 27, in __init__
  File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "build/bdist.linux-x86_64/egg/rasa_nlu/visualize.py", line 37, in do_GET
  File "build/bdist.linux-x86_64/egg/rasa_nlu/training_data.py", line 25, in __init__
    from rasa_nlu.tokenizers.mitie_tokenizer import MITIETokenizer
  File "build/bdist.linux-x86_64/egg/rasa_nlu/tokenizers/mitie_tokenizer.py", line 1, in <module>
ImportError: No module named mitie

Is there support for slot filling?

Hi there

Is there support for slot filling where the user can provide all the necessary info for a given intent over multiple interactions
Example:
User: I'm hungry
Bot: What kind of food would you like to eat?
User: Mexican
Bot: Are you looking to order delivery or go out?
User: Delivery
Bot: Here are some nearby options for Mexican food for delivery: ...

Or for a simpler more classic example - think booking an appointment where you're asked to provide time and with whom for instance.

Is there already support for this type of scenario? If so, could you point me to key parts of code/tutorial of relevance? If not, is this on the roadmap, and is there some workaround way to do this in the meantime?

Thank you

"advanced" number entity extraction

Hello,
Is it possible to train Rasa to extract numbers even in "tricky" cases like: 100K -> 100000, 100,000->100000, 100.5K -> 100500 etc.
wit/number entity managed to extracted it very well.

Thanks, Yevgeny

update to rasa output format

We should make the output format of parsed sentences identical to the rasa native data format

e.g. parsing "Show me chinese restaurants" currently returns :

{
        "text": "show me chinese restaurants",
        "intent": "inform",
        "entities": { 
            "cuisine" : "chinese"
        }
}

I'm proposing to change that to

{
     "text": "show me chinese restaurants",
     "intent": "inform",
     "entities": [ 
          {
            "start": 8,
            "end": 15,
            "value": "chinese",
            "entity": "cuisine"
          }
     ]
}

which the same as what we expect for input for training a model. Then we can log exactly these responses while the server is running and make it easy to add these back to training data to improve models

use unicode throughout

I think we should read training data files in as unicode, and just represent all text with unicode objects and not str.

In training_data.py I would propose we read the json files like this

import codecs
f = codecs.open('data.json', encoding='utf-8')
data = json.loads(f.read())

then we should only have unicode objects everywhere and we can avoid using any str at all. NB this may have downstream effects in e.g. spacy_tokenizer.py so we should run all the tests to check everything still works.

Intent classifier without entities

Hi there,
I'm trying to train an intent classifier without entities :

{
  "rasa_nlu_data": {
    "entity_examples": [
     ], 
    "intent_examples": [
      {
        "text": "hey", 
        "intent": "greet"
      }
     ...

And I got the following error :

raise Exception("You can't call train() on an empty trainer.")
Exception: You can't call train() on an empty trainer

There is a way to use only Intents?

Thanks in advance

Add confidence level to entities and intent

Would be great to return the confidence for an intent and/or entity, how does it work at the moment? does it return the best match ? Happy to help implementing this as well :)

Example of Using RASA as a Library

In the project's description, it says that

rasa NLU is written in Python, but it you can use it from any language through a HTTP API. If your project is written in Python you can simply import the relevant classes.

The documentation gives an example of how one would use RASA as a server, but there are no examples of how one would use RASA as a library directly in Python.

Could you add a basic example of model training and usage from Python?

spanish usage

hi there
is it possible to use RASA in spanish? with the MITIE model in spanish?
if so, could you please point me some resource to do all changes?
thanks
angelo

Training error

I am doing restaurants tutorial mentioned at http://rasa-nlu.readthedocs.io/en/latest/tutorial.html#section-tutorial

Doing it spacy_sklearn way

Downloaded spacy and all the models

I had scikit-learn installed, which was 0.18

I had data/demo-rasa.json so mentioned it in the config.json and not demo-restaurants.json

When I fiired following command:
python -m rasa_nlu.train -c config.json

I got error:

ImportError: cannot import name check_arrays

Thinking that its a scikit version issue (ref: http://stackoverflow.com/questions/29596237/import-check-arrays-from-sklearn) I installed 0.17.1 which gave following error:

ImportError: No module named model_selection

I am stuck now.. not sure what to do next...any hints?

[Question] Deploying to Heroku

There probably needs to be more documentation on how to deploy to heroku. I've added a deploy button in #89 and upon attempting to deploy, I now have to or have the option to fill in the following.

  • RASA_TOKEN (token for validating requests)
    • This is automatically generated, but what is this used for? Do I need to look up this value later?
  • RASA_BACKEND (which backend to use)
  • RASA_PATH (where to save models)
    • Am I generating these models? Do I need to back these up?
  • RASA_LOGDIR (where to save logs)
    • Fine as is. Could talk more about what is being logged.
  • RASA_MITIE_FILE (file containing mitie feature extractor)
    • If I'm using spacy_sklearn for my backend, why is this still required?
  • RASA_SERVER_MODEL_DIR (dir containing model which should be used to process requests)
  • AWS_SECRET_ACCESS_KEY (secret key for S3 access)
    • What permissions are required for uploading? Just PutObject or something else?
  • AWS_ACCESS_KEY_ID (key id for S3 access)
    • What permissions are required for uploading? Just PutObject or something else?
  • BUCKET_NAME (name of s3 bucket)
    • Is there a specific directory structure for the s3 bucket?
  • AWS_REGION (aws region of S3 bucket)
    • Fine as is.

There probably should be another document such as deploying-to-heroku.md or deploy/heroku.md explaining what each variable does.

MITIE install fails on Windows 10

Hi,

I'm trying to install MITIE backend on windows 10 using pip install git+https://github.com/mit-nlp/MITIE.git. However the install fails at the build step with the following error message.
`Collecting git+https://github.com/mit-nlp/MITIE.git
Cloning https://github.com/mit-nlp/MITIE.git to c:\users\njones\appdata\local\temp\pip-97mlgx-build
Installing collected packages: mitie
Running setup.py install for mitie: started
Running setup.py install for mitie: finished with status 'error'
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;file='c:\users\njones\appdata\local\temp\pip-97mlgx-build\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record c:\users\njones\appdata\local\temp\pip-ydwrn7-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
error: [Error 2] The system cannot find the file specified

----------------------------------------

Command "c:\python27\python.exe -u -c "import setuptools, tokenize;file='c:\users\njones\appdata\local\temp\pip-97mlgx-build\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record c:\users\njones\appdata\local\temp\pip-ydwrn7-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\njones\appdata\local\temp\pip-97mlgx-build`

Any suggestions on I could be doing wrong would be really helpful!

Thanks

multitenancy support

This suggestion also comes from @3x14159265 .
Idea is to have rasa NLU provide multiple apps, e.g. have several models loaded into memory and serve requests based on them (routed by the URL).

The simplest approach is to start a separate server for each model, and use a supervisor. But each process will have word vectors loaded into memory, which means you can't fit very many on a server.

A better way would be to have several models loaded within one server, although I think only the spaCy backend would actually be able to share the large memory component between them. Would probably be doable to modify MITIE to support that as well.

To help plan this out, would be really helpful if people wrote their intended deployment setup here, so we can discuss various trade-offs.

server should handle nonascii text

if we add some non-ascii text in test_post_parse() the encoding isn't right. see lines 57-59 in test_server.py

        req = requests.post(http_server + "/parse", json={"q": u"hello ńöñàśçií"})
        expected = [{"entities": {}, "confidence": None, "intent": "greet", "_text": "hello ńöñàśçií"}]
       assert req.status_code == 200 and req.json() == expected

this fails

support for training data fetched from DB

I like this idea, suggested by @3x14159265 of being able to load training data from a DB rather than a json file. Primarily because a DB is a more flexible & robust way to store that data, and not because of performance.

If possible, I don't want rasa NLU to dictate what database people use to store their stuff. So maybe we can create an abstract TrainingDataLoader class, from which everything else derives, including the ones which read json files. Then users can subclass that to read from whichever DB they like.

Fulfillment is Empty

Hi,

I have Rasa installed with MITIE backend. I trained my models from API.ai, using my own and using the ones I found in the examples folder. Unfortunately, it responds with an empty "fulfillment" every time I make a query. Please advise.

Best,
Aaron

MITIEInterpreter

I have got an error while running main.py, seems to be pointing to MITIEInterpreter. the init functions takes in 3 parameter and 3 was passed into the function (interpreter = MITIEInterpreter(config.classifier_file,config.ner_file,config.fe_file)) via main.py but i still get an error, could you look into it please.

self.extractor = named_entity_extractor(ner_file,fe_filepath)
TypeError: __init__() takes exactly 2 arguments (3 given)

Apache license problematic for vendorizing code, e.g. visualizer

Hi,

First, congrats on the launch! Glad to see the Python NLP ecosystem getting even stronger. We're rolling out more spaCy models early next year that should be relevant to you guys.

I noticed some administrivia I'd like to raise, though. It's useful to get these things straightened out early...

I see you guys have chosen to go with the Apache license. I think this might be a problem, because it means you'll have to think carefully about the licensing of code that ends up in your repository.

There's already an example of the problem in rasa's entity visualizer, which includes code copy-pasted from our entity visualizer. The relevant commit is here.

If you make Rasa MIT licensed, you'll be able to cut-and-paste code from MIT libraries like this, so long as you attribute it. But if you keep Rasa under the Apache license, you'll only be able to include Apache licensed code in the library.

While this isn't a big deal for the visualizer, you could later get some substantial patches that are actually sourced from an MIT library, without you knowing it. By distributing this under the Apache license, you'll be giving people the impression that they don't need to attribute the code to the original author. You won't be able to fix this problem by simply adding an attribution line — you'll have to delete the code, or change your license.

Matt

numpy is always required

the MITIEFeaturizer actually uses numpy, in the create_bow_vecs function.
We should document this.

document `intent` versus `entity` for wit users

wit no longer has a native concept of an intent , so for new users of wit they won't know what that means. we'll also have to figure out how to parse exported wit apps which don't have any intents defined

tests for train.py and server.py

these scripts are currently not well covered by unit tests. I think coveralls doesn't report that because they're considered 'outside' the rasa_nlu module

logging verbosity options

I think we should give the user some control over the level of logging output.

option 1: default is to be very verbose, make a -q quiet command line flag to suppress

option 2: default is minimal logging, make -v verbose flag to help debugging

Rasa.ai added value

Hey,

Rasa.ai looks like a very interesting framework and seems to address main weak point of the current hosted NLP API solutions

We've been working for a while with scapy which makes a good work for us till now.
Should we consider switching to rasa.ai and for what reasons? I mean it seems like your framework uses scapy a lot, for example your tokenizer uses scapy's one (or mitie's) so what are use cases you aimed to simplify/enhance and how your framework does it better than the backend libraries it wraps?

Unable to detect entities from exported data of api.ai

I imported one agent's data from api.ai to rasa and faced below mentioned issues in response -

  1. Not able to detect entities.
  2. It was working fine for exact statements ,but for even slightly different it was detecting random intents.
  3. Even for gibberish data it was detecting one or the other intent. Keeping into account that we can't have confidence of detection , its impossible to know whether we have detected correct intent or not.

To further debug the issue if you want to have exported data let me know I will mail you.

ImportError: No module named mitie

I keep on getting this error when trying to run the train command.

python -m rasa_nlu.train -c config.json
Traceback (most recent call last):
  File "D:\Programs\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "D:\Programs\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "build\bdist.win32\egg\rasa_nlu\train.py", line 65, in <module>
  File "build\bdist.win32\egg\rasa_nlu\train.py", line 54, in do_train
  File "build\bdist.win32\egg\rasa_nlu\train.py", line 28, in create_trainer
  File "build\bdist.win32\egg\rasa_nlu\trainers\mitie_trainer.py", line 1, in <module>
ImportError: No module named mitie

I already have the MITIE-models and config.json setup accordingly

{
  "backend": "mitie",
  "path" : "./",
  "mitie_file" : "D:\\Projects\\mities\\english\\total_word_feature_extractor.dat",
  "data" : "./data/demo-restaurants.json"
}

Is there something that I might be missing?

KeyError 'text'

I have trained the demo-restaurants.json and booted up a server, but when I query, I get a KeyError Exception

Exception happened during processing of request from ('127.0.0.1', 43896)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/home/lalithmohan/.local/lib/python2.7/site-packages/rasa_nlu/server.py", line 75, in <lambda>
    self.server = HTTPServer(('', self.config.port), lambda *args: RasaRequestHandler(self.data_router, *args))
  File "/home/lalithmohan/.local/lib/python2.7/site-packages/rasa_nlu/server.py", line 159, in __init__
    BaseHTTPRequestHandler.__init__(self, *args)
  File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "/home/lalithmohan/.local/lib/python2.7/site-packages/rasa_nlu/server.py", line 201, in do_POST
    self.wfile.write(self.get_response(data_dict))
  File "/home/lalithmohan/.local/lib/python2.7/site-packages/rasa_nlu/server.py", line 175, in get_response
    result = self.data_router.parse(data["text"])
KeyError: 'text'

I have both the data and mitie_file in the same directory and have installed mitie backend. I also tried sending the key as "text" instead of "q"in the POST, but it gives the wrong intent and entities. I don't know what I'm missing here. Here's my config.json

{ "backend": "mitie", "path" : "./", "mitie_file" : "total_word_feature_extractor.dat", "data" : "demo-rasa.json" }

fix documentation for api endpoints

we currently claim that 'emulating' as service only affects the json format of the response. This is incorrect because the API methods actually also change, so that the user should only have to change the url they're sending requests to. need to make clear this is always the case (including for api.ai) & documented as such.

simple web app for creating training data

I'm sure some users will want some kind of GUI for rasa NLU.

We currently have the visualizer which can render training data. Would be cool to have a simple web app which can create formatted training data files, similarly to the wit.ai / LUIS interfaces.

Just comment here if you would like to work on it, or have suggestions on how it should be done

add error message when no logfile key is specified in config.json

Problem
Two scenarios:

  • no config file specified. Empty dict is used as default configuration;
  • config file specified, but the dictionary holds no logfile key;

DataRouter() in server.py assigns self.logfile=config["logfile"] but get method fails.

Possible Solution
verify if key is present in config dict:

  • trigger an error and exit;
  • use default value.

Build a Botkit Middleware

Botkit is a Node-based tool for building bots. Many developers use API-powered NLP tools right now via a middleware system.

We should create a middleware for Botkit that:

  • sends messages received by the bot to the developer's rasa endpoint, amends the message with intent and entity information
  • exposes a trigger conditional that allows the bot to 'hear' intents from rasa

Though the specific details will be different, this will be virtually identical in form to any of the other NLP middlewares, such as botkit-wit:
https://github.com/SnowStormIO/botkit-witai

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.