Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named Entity Chunker #120

Closed
wants to merge 6 commits into from

Conversation

DarkmatterVale
Copy link
Collaborator

This PR adds a named entity chunker to Chatterbot's utilities.

@DarkmatterVale
Copy link
Collaborator Author

@gunthercox Any ideas why the travis-ci build isn't working? I tested it on my end and it works fine on my machine.

@gunthercox
Copy link
Owner

Not sure at the moment, looks like the issue is with numpy https://travis-ci.org/gunthercox/ChatterBot/jobs/105661593

@DarkmatterVale
Copy link
Collaborator Author

It is a weird error because it works fine on Python 3.4, 3.3, 3, and 2.7. Can you reproduce the error on your machine?

@gunthercox
Copy link
Owner

I cannot, it appears to work correctly for me as well (although I already have numpy installed).

What was the reason for adding numpy to the requirements file? I don't actually see it being imported anywhere.

@DarkmatterVale
Copy link
Collaborator Author

I read online that numpy was required to be on the system but not imported into the program you are using the chunker in. And I believe I got an error with out it in requirements.

@gunthercox
Copy link
Owner

I don't believe it's needed. I do see that it is included in NLTK's requirements, but they don't appear to be installing it on setup (https://github.com/nltk/nltk/blob/develop/pip-req.txt#L5). Their documentation does say that numpy is optional (http://www.nltk.org/install.html).

@DarkmatterVale
Copy link
Collaborator Author

When I remove numpy from requirements, it throws a "no module named numpy" error. But this is only on the pypy tests, so maybe it is something wrong on their end? I'm not really sure why it works with python 3.4, 3.3, 3, and 2.7 while it doesn't work with pypy; do they each run different tests?

@gunthercox
Copy link
Owner

Ah, interesting just found a note in the documentation for travis-ci (https://docs.travis-ci.com/user/ci-environment/#Preinstalled-pip-packages)

On all versions except pypy and pypy3 have numpy as well.

So the "issue" is occurring on travis's side. Travis normally has numpy preinstalled so that test builds can be created faster in the virtual environment. So far I have seen a lot of remarks that manually installing numpy and other scientific python packages significantly increases build time.

It should also be noted that there is currently known issues that will occur in a Windows environment when installing python modules with c extensions as requirements. This is the reason for instance that the python-Levenshtein package isn't required in this module.

There may be a way to include numpy in the .travis configuration file (similar to how it is done for mongodb: https://github.com/gunthercox/ChatterBot/blob/master/.travis.yml (Although I have not been able to find evidence of this in any of the documentation yet).


Also, I just noticed the test case for the named entity taggger (https://github.com/gunthercox/ChatterBot/pull/120/files#diff-87010571bbeeee0b9a13279c493670f3R42). This looks like a good negative test case (the case that no named entities are found). It is important to include a positive test case as well to show the case of the named entity tagger succeeding.

@gunthercox
Copy link
Owner

@DarkmatterVale I believe you can add numpy to the travis builds manually by manually installing it:

 install:
+  - sudo apt-get install python-numpy
   - pip install coveralls
-  - pip install nltk
   - pip install -r requirements.txt

(you can also remove the pip install nltk line as it is already included in the requirements.txt file.)

@DarkmatterVale DarkmatterVale force-pushed the utility_kit branch 7 times, most recently from 6688bac to 2ed8286 Compare January 30, 2016 17:06
@DarkmatterVale
Copy link
Collaborator Author

Sorry for all the spam emails from Travis-Ci...Trying different things to see if numpy will install. I have not been able to find a solution so far.

@gunthercox Using sudo throws a permission error. If I remove sudo, apt-get doesn't work. I'll leave it at what you asked, however, so you can see the output of the most recent build yourself.

@gunthercox
Copy link
Owner

Sorry, my mistake.
The package should have been apt-get install python-numpy without the sudo. I believe travis while lists it so it can be installed this way without sudo.

@DarkmatterVale
Copy link
Collaborator Author

That does not work either, as is visible by the travis build.

@gunthercox
Copy link
Owner

The first line in .travis.yml is sudo: false, want to try removing that and adding back the sudo to the apt-get install line?

@DarkmatterVale DarkmatterVale force-pushed the utility_kit branch 2 times, most recently from 6089fb0 to aa766a1 Compare January 30, 2016 18:03
@DarkmatterVale
Copy link
Collaborator Author

@gunthercox Still doesn't work...

@kevin-brown
Copy link
Contributor

In order to install packages using APT on the container based builds (so, by default) you need to use the APT addon.

As far as getting numpy installed under pypy, you may want to look at travis-ci/travis-ci#2650.

@DarkmatterVale
Copy link
Collaborator Author

@kevin-brown I added the APT addon as suggested, but it still doesn't build. Am I doing it incorrectly?

@gunthercox gunthercox closed this May 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants