Comments (6)
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.
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.
19.txt
Here is the file that's causing the issue for me.
from spacy-lefff.
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
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.
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.
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)
- Building a better mapping between Lefff and Spacy POS HOT 1
- POS tags in Lefff are missing some cases
- Migrating to latest spacy Version : Fixing issue with set_extension to Token
- Python 3 Support HOT 1
- Repeating "downloading" line in debugger logging when downloading data
- Add output of code snippet to readme
- Review the mapping between Lefff and MElt
- Add the benchmark from MElt and Lefff papers in the README HOT 2
- Wrong analysis of adjectives after a verb HOT 1
- Hide debugging printing comments HOT 1
- Use .melt_tagger several times HOT 1
- weird error HOT 3
- Melt tagger do not use its data_dir param HOT 9
- Missing File HOT 8
- Can't find model 'fr_core_news_sm' HOT 6
- Package compatibility not possible
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spacy-lefff.