Git Product home page Git Product logo

Comments (6)

brygotti avatar brygotti commented on July 17, 2024

I've had the same problem, except your fix didn't work for me. The token actually has the attribute melt_tagger, but it is set to None. So to fix the problem, I changed the line to:
try:
t = token._.melt_tagger.lower() if self.after_melt and hasattr(token._, 'melt_tagger') else token.pos_
except AttributeError:
t = token.pos_

from spacy-lefff.

sammous avatar sammous commented on July 17, 2024

thank you for reporting the issue, i will fix this asap. Can you give me the example that raised the issue so i can update my test case accordingly ?

from spacy-lefff.

brygotti avatar brygotti commented on July 17, 2024

19.txt
Here is the file that's causing the issue for me.

from spacy-lefff.

sammous avatar sammous commented on July 17, 2024

Is the exception you have coming from the print statement I forgot to remove ? https://github.com/sammous/spacy-lefff/blob/master/spacy_lefff/lefff.py#L62
image
I updated last week the code to keep default values if nothing is found and forgot to remove this print statement.
Or do you actually get a Python error ?

from spacy-lefff.

brygotti avatar brygotti commented on July 17, 2024

File "D:\Documents\ML-PDF-Reader\test.py", line 109, in test
processed_doc = nlp(text)
File "C:\Program Files\Python35\Lib\site-packages\spacy\language.py", line 402, in __call__
doc = proc(doc, **component_cfg.get(name, {}))
File "C:\Program Files\Python35\Lib\site-packages\spacy_lefff\lefff.py", line 69, in __call__
t = token._.melt_tagger.lower() if self.after_melt and hasattr(token._, 'melt_tagger') else token.pos_

builtins.AttributeError: 'NoneType' object has no attribute 'lower'

Here is the exception I'm getting. The code i've used is the one from here, and the nlp model is fr_core_news_sm

from spacy-lefff.

sammous avatar sammous commented on July 17, 2024

great thank you, apparently the problem comes from the breakline.
this works

nlp("some text")

but this doesn't

nlp("some text\n")

from spacy-lefff.

Related Issues (17)

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.