Giter Site home page Giter Site logo

treetagger-python's People

Contributors

arne-cl avatar beartice avatar diyclassics avatar miotto avatar mromanello avatar rrafaelpinto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

treetagger-python's Issues

TypeError: __init__() got an unexpected keyword argument 'encoding'

Hello Sir,
I installed all the prerequisites. But when the run the code treetagger_python2.py I got the above error, though when I go through the actual file I could see the init method does take the parameter encoding

File "treetagger_python2.py", line 47, in main.TreeTagger
Failed example:
tt = TreeTagger(encoding='utf-8',language='english')
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python2.7/doctest.py", line 1315, in __run
compileflags, 1) in test.globs
File "<doctest main.TreeTagger[1]>", line 1, in
tt = TreeTagger(encoding='utf-8',language='english')
TypeError: init() got an unexpected keyword argument 'encoding'

TreeTagger.tag() return empty array

I've installed the TreeTagger and treetagger-python from pip. I want to tag my sentence with this package. But, it only return empty array, i've tried some other sentence and it goes same. Here is my code. It has no error.

from treetagger import TreeTagger
tt = TreeTagger(language='english')
        row = row[0]
        sentence = "When I am alone in a room with no contact with anyone - a loneliness draines me."
        print(sentence)
        tt.tag(sentence)

Please help, Thanks

TreeTaggerChunker not recognizing language

Hi, i have succesfully installed treetagger and i can now pos tag sentences in italian, but treetaggerchunker does not detect the same language i use with treetagger. Do i have to install the language in a different way?
Thanks

a problem with tag() return type

Hi, you might recognize the code from your "README", I'm sorry to bother if my question is stupid and I thank you for the work you provided for us.

Here is the code I use ;

from treetagger import TreeTagger
tt = TreeTagger(path_to_treetagger='C:\TreeTagger')

tmp = tt.tag('What is the airspeed of an unladen swallow?')
print(tmp)

with or without the tmp and the print, I get the same return which is "[['Usage: tag-english file {file}']]".

I should get something different, in your example you get a proper answer. I tried some tests and added some prints in the tag function they all go right. I don't understand the problem and I would be grateful if you could help me.

The tt.get_installed_lang() method works just fine and so does the Tree Tagger on his own when I call it with a .txt file.

Many thanks again for your work.

PS: I'm sorry for the many mistakes you will find in this text, english is not my mother tongue.

NLTK was unable to find the TreeTagger bin!

Hello,

I am trying to use treetagger-python and I don't seem to have it working properly.
I downloaded TreeTagger and installed it in ~/treetagger and therefore set TREETAGGER_HOME to this path in my .bashrc file.

However, when I want to use it, I get the following error:

NLTK was unable to find the TreeTagger bin!

I think it comes from a TREETAGGER_HOME which is misconfigured, but I actually have no clue of what could be the correct path.

I also may be wrong and the error could come from somewhere else.

Could you please enlighten me?

Thanks a lot!

TypeError: str() takes at most 1 argument (2 given)

When executing I am getting the following Error Message.

Traceback (most recent call last):
  File "tt_testfile.py", line 7, in <module>
    pprint(tt.tag('What is the airspeed of an unladen swallow?'))
  File "build/bdist.linux-i686/egg/treetagger.py", line 123, in tag
TypeError: str() takes at most 1 argument (2 given)

The Error points to (stdout, stderr) = p.communicate(bytes(_input, 'UTF-8')).

not language installed bug - get_installed_lang looks like broken

Actually, if I download and install treetagger (http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/), with a language, for exemple, french, a python call to treetagger fail, because installed language was not found.

https://github.com/miotto/treetagger-python/blob/master/treetagger.py#L135

The language file is named french.par, but treetagger-python try to find a *-utf8.par . I don't know why, maybe the naming convention was recently changed.

To temporaly fix the problem, we should copy (not move, if you want treetagger still work) the .par file, and add -utf8 before the dot. Like that: french.par -> french-utf8.par

(P.S: Thanks for your work !)

License

Dear Mirko,

could you please add a license to treetagger-python?

Best,
Arne

OSError: [Errno 8] Exec format error

I ran the given example code and got the following error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "build/bdist.linux-x86_64/egg/treetagger.py", line 141, in tag File "/usr/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child raise child_exception OSError: [Errno 8] Exec format error

AttributeError: 'TreeTagger' object has no attribute '_treetagger_bin'

Hello:
I'm trying to run the example:

from treetagger import TreeTagger
tt = TreeTagger(language='english')
tt.tag('What is the airspeed of an unladen swallow?')

and i get the following error:

AttributeError: 'TreeTagger' object has no attribute '_treetagger_bin'

I can use some help. Thanks

Throws out a a LookupError

Hi. I need some help. I was able to run it before. But I dont know why it doesnt work anymore. It prints this error below. I've edited the .bash_profile and .zshrc also. I'm sorry also, I dont know if I should ask it here.

LookupError:

NLTK was unable to find the tree-tagger-english file!
Use software specific configuration paramaters or set the TREETAGGER environment variable.

Searched in:
- .
- /usr/bin
- /usr/local/bin
- /opt/local/bin
- /Applications/bin
- /Users/roybayot/bin
- /Users/roybayot/Applications/bin
- /Users/roybayot/work/TreeTagger/cmd

For more information, on tree-tagger-english, see:

http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/

Added to my .zshrc the things written below. My .bash_profile is also similar.

Configure TREE TAGGER PATH

export TREE_TAGGER_PATH='/Users/roybayot/Desktop/new_tree_tagger/'
export TREE_TAGGER_PATH=$TREE_TAGGER_PATH:/Users/roybayot/Desktop/new_tree_tagger
export TREE_TAGGER_PATH=$TREE_TAGGER_PATH:/Users/roybayot/Desktop/new_tree_tagger/bin
export TREE_TAGGER_PATH=$TREE_TAGGER_PATH:/Users/roybayot/Desktop/new_tree_tagger/cmd

export TREETAGGER_HOME='/Users/roybayot/Desktop/new_tree_tagger/'
export TREETAGGER_HOME=$TREETAGGER_HOME:/Users/roybayot/Desktop/new_tree_tagger
export TREETAGGER_HOME=$TREETAGGER_HOME:/Users/roybayot/Desktop/new_tree_tagger/bin
export TREETAGGER_HOME=$TREETAGGER_HOME:/Users/roybayot/Desktop/new_tree_tagger/cmd

export TREETAGGER='/Users/roybayot/Desktop/new_tree_tagger/'
export TREETAGGER=$TREETAGGER:/Users/roybayot/Desktop/new_tree_tagger
export TREETAGGER=$TREETAGGER:/Users/roybayot/Desktop/new_tree_tagger/bin
export TREETAGGER=$TREETAGGER:/Users/roybayot/Desktop/new_tree_tagger/cmd
export TAGDIR=/Users/roybayot/Desktop/new_tree_tagger/
export TREETAGGER_HOME=/Users/roybayot/Desktop/new_tree_tagger
export TREETAGGER_HOME=$TREETAGGER_HOME:/Users/roybayot/Desktop/new_tree_tagger/cmd
export TREETAGGER_HOME=$TREETAGGER_HOME:/Users/roybayot/Desktop/new_tree_tagger/bin

export TREE_TAGGER_PATH=/Users/roybayot/Desktop/new_tree_tagger
export TREE_TAGGER_PATH=$TREE_TAGGER_PATH:/Users/roybayot/Desktop/new_tree_tagger/cmd
export TREE_TAGGER_PATH=$TREE_TAGGER_PATH:/Users/roybayot/Desktop/new_tree_tagger/bin

export TREETAGGER_HOME=/Users/roybayot/Desktop/new_tree_tagger
export TREETAGGER_HOME=$TREETAGGER_HOME:/Users/roybayot/Desktop/new_tree_tagger/cmd
export TREETAGGER_HOME=$TREETAGGER_HOME:/Users/roybayot/Desktop/new_tree_tagger/bin

Add python path

export PYTHONPATH=$PYTHONPATH:/Users/roybayot/Desktop/new_tree_tagger/
export PYTHONPATH=$PYTHONPATH:/Users/roybayot/Desktop/new_tree_tagger/cmd/
export PYTHONPATH=$PYTHONPATH:/Users/roybayot/Desktop/new_tree_tagger/bin/

Explicitly configured $PATH variable

PATH=/usr/local/git/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/local/bin:/opt/local/sbin:/usr/X11/bin:/Users/roybayot/Desktop/TreeTagger:/Users/roybayot/Desktop/TreeTagger/cmd:/Users/roybayot/Desktop/TreeTagger/bin:/Users/roybayot/Desktop/new_tree_tagger:/Users/roybayot/Desktop/new_tree_tagger/cmd:/Users/roybayot/Desktop/new_tree_tagger/bin

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.