New installation on Cray: Traceback from backoff import BackoffLatinLemmatizer LatinLanguageVars _re_non_word_chars = PunktLanguageVars._re_non_word_chars.replace("'", "") AttributeError: 'property' object has no attribute 'replace'
See original GitHub issueOur team has been using CLTK on administered CRAY academic computers since last July to lemmatize a digital edition of the medieval philosopher Richard Rufus of Cornwall, all Latin.
The team member who led our adoption of CLTK has found a new position, and in anticipation of training a replacement, three days ago, I installed CLTK according to current installation instructions for developers on an account where we had not installed it before.
We have a python script with the informative name lemmas.py but whose opening lines call backoff.py:
import os
import re
# LEMMATIZATION
backoff = open("backoff.py", "r")
from backoff import BackoffLatinLemmatizer
lemmatizer = BackoffLatinLemmatizer()
My colleague has added the Thomist lemmas, morelemmas, and ourlemmas (additions) following the paradigm in backoff, and that program has been working well for months.
Under the new installation, I see the following:
(venv) whooper@elogin1:/N/slate/whooper/rufus/demo> python3 lemmas.py
Traceback (most recent call last):
File "lemmas.py", line 9, in <module>
from backoff import BackoffLatinLemmatizer
File "/N/.../demo/backoff.py", line 18, in <module>
from cltk.lemmatize.backoff import DefaultLemmatizer, IdentityLemmatizer, DictLemmatizer, RegexpLemmatizer, UnigramLemmatizer
File "/...(my user).../venv/lib/python3.8/site-packages/cltk/__init__.py", line 5, in <module>
from .nlp import NLP
File "/...(my user).../venv/lib/python3.8/site-packages/cltk/nlp.py", line 9, in <module>
from cltk.languages.pipelines import (
File "/...(my user).../venv/lib/python3.8/site-packages/cltk/languages/pipelines.py", line 48, in <module>
from cltk.tokenizers.processes import (
File "/...(my user).../venv/lib/python3.8/site-packages/cltk/tokenizers/__init__.py", line 3, in <module>
from .processes import *
File "/...(my user).../venv/lib/python3.8/site-packages/cltk/tokenizers/processes.py", line 18, in <module>
from cltk.tokenizers.lat.lat import LatinWordTokenizer
File "/...(my user).../venv/lib/python3.8/site-packages/cltk/tokenizers/lat/lat.py", line 14, in <module>
from cltk.sentence.lat import LatinPunktSentenceTokenizer
File "/...(my user)...venv/lib/python3.8/site-packages/cltk/sentence/lat.py", line 25, in <module>
class LatinLanguageVars(PunktLanguageVars):
File "/...(my user).../venv/lib/python3.8/site-packages/cltk/sentence/lat.py", line 26, in LatinLanguageVars
_re_non_word_chars = PunktLanguageVars._re_non_word_chars.replace("'", "")
AttributeError: 'property' object has no attribute 'replace'
I tried to trace the opening steps in our lemmas.py program, but the debugging caret dives into cltk libraries immediately after trying to execute our copy of backoff.py, as you can see from the Traceout.
Does this error look familiar? Is this installation instance missing a file? I think all the named files are there but I haven’t paid close attention before. Can you advise? It is an administered environment but we are free to use venv and the previous installation of CLTK worked very smoothly.
By the way, we all think CLTK is great, well done.
Thanks, Wally Hooper Chymistry of Isaac Newton Project/Richard Rufus Project Indiana University, Bloomington
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
Yes, I think I’m going to rewrite everything using the latest CLTK stable version API to be able to support our own codebase later. Thank you!
@alexeyev We do not support the 0.x versions anymore, but we’re glad to hear they still work!
To upgrade to the latest 1.x, you would do
pip install -U cltk
but I have to warn you that almost everything in it is different. You can read more here: https://docs.cltk.org/en/latest/quickstart.html