Git Product home page Git Product logo

Comments (5)

dat avatar dat commented on August 18, 2024

This is because you're deploying it via the Java server option using the normal socket. You should be building it as a .war file (see Makefile) and deploy it as a servlet under Tomcat.

from pyner.

dat avatar dat commented on August 18, 2024

If this is the mode that you're interested in running, take a look at the SocketNER class. That is what you're looking for.

from pyner.

Liontooth avatar Liontooth commented on August 18, 2024

I found this worked on a fresh stanford-ner 3.4 and pyner --

$ cp stanford-ner.jar stanford-ner-with-classifier.jar
$ jar -uf stanford-ner-with-classifier.jar classifiers/english.all.3class.distsim.crf.ser.gz
$ java -mx500m -cp stanford-ner-with-classifier.jar edu.stanford.nlp.ie.NERServer -port 2020 
 -loadClassifier classifiers/english.all.3class.distsim.crf.ser.gz &

Define the tagger

tagger = ner.SocketNER(host='localhost', port=2020, output_format='slashTags')

If I leave out the output_format, or try another format, I get {} output. The actual output format, however, is not slashTags but a clearly superior (more informative) dict format:

tagger.get_entities(text)
{u'ORGANIZATION': [u'UNIVERSITY OF CALIFORNIA'], u'LOCATION': [u'CALIFORNIA', u'UNITED STATES'], u'O': [u'IS LOCATED IN', u',']}

from pyner.

Liontooth avatar Liontooth commented on August 18, 2024

Incidentally, I also discovered that pyner works fine for stanford-pos too, though none of the custom formatting of the result string works. Just use tag_text for raw output and you have pypos.

from pyner.

fintrader avatar fintrader commented on August 18, 2024

I think this case should be re-opened. Even using SocketNER I experienced the same issue but once output_format was specified to "slashTags" everything worked well

Without specifying output_format:

tagger = ner.SocketNER(host='localhost',port=9191)
tagger.get_entities("University of California is located in California, United States")

Returned:

{}

With specifying output_format:

tagger = ner.SocketNER(host='localhost',port=9191, output_format='slashTags')
tagger.get_entities("University of California is located in California, United States")

Returned:

{u'LOCATION': [u'California', u'United States'],
 u'O': [u'is located in', u','],
 u'ORGANIZATION': [u'University of California']}

Either way, appreciate of the work you're doing dat. Thank you so much for all that you do

from pyner.

Related Issues (13)

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.