question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unrecognized value error for .analyze with Coptic text

See original GitHub issue

I am not sure if this is a bug or if CLTK (Coptic pipeline) is not yet running smoothly on my system. I run into an error when I try to use the .analyze method on a piece of Coptic text.

To Reproduce Steps to reproduce the behavior:

  1. Python version 3.7

  2. Install CLTK version 1.1 (installed after your talk in the Digital Classicist Berlin Seminar yesterday) with Anaconda as venv

  3. Open Jupyter Notebook

  4. Code … (literal copy-paste)

from cltk import NLP

cop_nlp = NLP(language=“cop”)

coptext = “ⲓⲁⲕⲱⲃⲟⲥ ⲡϩⲙϩⲁⲗ ⲙⲡⲛⲟⲩⲧⲉ ⲁⲩⲱ ⲡϫⲟⲉⲓⲥ ⲓⲏⲥ ⲡⲉⲭⲥ ⲉϥⲥϩⲁⲓ ⲛⲧⲙⲛⲧⲥⲛⲟⲟⲩⲥ ⲙⲫⲩⲗⲏ ⲉⲧϩⲉⲛ ⲧⲇⲓⲁⲥⲡⲟⲣⲁ ⲭⲁⲓⲣⲉⲧⲉ ⲟⲡϥ ⲉⲩⲛⲟϭ ⲛⲣⲁϣⲉ ⲛⲁⲥⲛⲏⲩ ⲉⲧⲉⲧⲛϣⲁⲛⲉⲓ ⲉϩⲣⲁⲓ ϩⲛ ⲛⲉⲛⲡⲉⲓⲣⲁⲥⲙⲟⲥ ⲉⲩϣⲟⲃⲉ ⲉⲧⲉⲧⲛⲥⲟⲟⲩⲛ ϫⲉ ⲇⲟⲕⲓⲙⲏ ⲛⲧⲉⲧⲛⲡⲓⲥⲧⲓⲥ ⲉⲥⲣ ϩⲱⲃ ⲉⲩϩⲩⲡⲟⲙⲟⲛⲏ ⲑⲩⲡⲟⲙⲟⲛⲏ ⲇⲉ ⲙⲁⲣⲉⲥϣⲱⲡⲉ ⲉⲩⲟⲩⲛⲧⲁⲥ ⲙⲙⲁⲩ ⲛⲛⲟⲩϩⲱⲃ ⲛⲧⲉⲗⲓⲟⲛ ϫⲉⲕⲁⲥ ⲉⲧⲉⲧⲛⲛⲁϣⲱⲡⲉ ⲛⲧⲉⲗⲉⲟⲥ ⲁⲩⲱ ⲉⲧⲉⲧⲛϫⲏⲕ ⲉⲃⲟⲗ ⲛⲧⲉⲧⲛϣⲁⲁⲧ ⲁⲛ ⲛⲗⲁⲁⲩ ⲉϣϫⲉ ⲟⲩⲛ ⲟⲩⲁ ⲇⲉ ⲙⲙⲱⲧⲛ ϣⲁⲁⲧ ⲛⲛⲟⲩⲥⲟⲫⲓⲁ ⲙⲁⲣⲉϥⲁⲓⲧⲉⲓ ⲉⲃⲟⲗ ϩⲓⲧⲙ ⲡⲛⲟⲩⲧⲉ ⲉⲧϯ ⲛⲟⲩⲟⲛ ⲛⲓⲙ ϩⲁⲡⲗⲱⲥ ⲛϥⲛⲟϭⲛⲉϭ ⲁⲛ ⲁⲩⲱ ϥⲛⲁϯ ⲛⲁϥ ⲙⲁⲣⲉϥⲁⲓⲧⲉⲓ ⲇⲉ ϩⲛ ⲟⲩⲡⲓⲥⲧⲓⲥ ⲛϥⲇⲓⲁⲕⲣⲓⲛⲉ ⲛⲗⲁⲁⲩ ⲁⲛ ⲡⲉⲧⲇⲓⲁⲕⲣⲓⲛⲉ ⲅⲁⲣ ⲉϥⲟ ⲛⲑⲉ ⲛⲟⲩϩⲟⲉⲓⲙ ⲛⲧⲉ ⲑⲁⲗⲁⲥⲥⲁ ⲉⲣⲉⲡⲧⲏⲩ ⲣⲱϩⲧ ⲙⲙⲟϥ ⲁⲩⲱ ⲉϥϣⲱⲱϭⲉ ⲙⲙⲟϥ ⲙⲡⲉⲣⲧⲉⲣⲉϥⲙⲉⲉⲩⲉ ⲅⲁⲣ ⲛϭⲓ ⲡⲣⲱⲙⲉ ⲉⲧⲙⲙⲁⲩ ϫⲉ ϥⲛⲁϫⲓ ⲗⲁⲁⲩ ⲉⲃⲟⲗ ϩⲓⲧⲟⲟⲧϥ ⲙⲡϫⲟⲉⲓⲥ ⲡⲣⲱⲙⲉ ⲉⲛϩⲏⲧ ⲥⲛⲁⲩ ϥϣⲧⲣⲧⲱⲣ ϩⲣⲁⲓ ϩⲛ ⲛⲉϥϩⲓⲟⲟⲩⲉ ⲧⲏⲣⲟⲩ ⲙⲁⲣⲉϥϣⲟⲩϣⲟⲩ ⲇⲉ ⲙⲙⲟϥ ⲛϭⲓ ⲡⲥⲟⲛ ⲉⲧⲑⲃⲃⲓⲉⲏⲩ ⲉϩⲣⲁⲓ ϩⲙ ⲡⲉϥϫⲓⲥⲉ ⲁⲩⲱ ⲡⲣⲙⲁⲟ ϩⲣⲁⲓ ϩⲙ ⲡⲉϥⲑⲃⲃⲓⲟ ϫⲉ ϥⲛⲁⲟⲩⲉⲓⲛⲉ ⲛⲑⲉ ⲛⲛⲟⲩϩⲣⲏⲣⲉ ⲛⲭⲟⲣⲧⲟⲥ ⲁϥϣⲁ ⲅⲁⲣ ⲛϭⲓ ⲡⲣⲏ ⲙⲛ ⲡⲕⲁⲩⲙⲁ ⲁϥⲧⲣⲉ ⲡⲉⲭⲟⲣⲧⲟⲥ ϣⲟⲟⲩⲉ ⲁⲩⲱ ⲡⲉϥϩⲣⲏⲣⲉ ⲁϥⲥⲣⲟϥⲣⲉϥ ⲡⲥⲁ ⲙⲡⲉϥϩⲟ ⲁϥⲧⲁⲕⲟ ⲧⲁⲓ ϩⲱⲱϥ ⲧⲉ ⲧⲑⲉ ⲙⲡⲣⲙⲁⲟ ⲉϥⲛⲁϩⲱϭⲉⲃ ϩⲛ ⲛⲉϥϩⲓⲟⲟⲩⲉ ⲛⲁⲓⲁⲧϥ ⲉⲡⲣⲱⲙⲉ ⲉⲧⲛⲁϥⲉⲓ ϩⲁ ⲟⲩⲡⲉⲓⲣⲁⲥⲙⲟⲥ ϫⲉ ⲁϥϣⲱⲡⲉ ⲛⲥⲱⲡⲧ ϥⲛⲁϫⲓ ⲙⲡⲉⲕⲗⲟⲙ ⲙⲡⲱⲛϩ ⲡⲁⲓ ⲛⲧⲁϥⲉⲣⲏⲧ ⲙⲙⲟϥ ⲛⲛⲉⲧⲙⲉ ⲙⲙⲟϥ ⲙⲡⲉⲣⲧⲉ ⲗⲉⲗⲁⲁⲩ ϫⲟⲟⲥ ⲉⲩⲡⲉⲓⲣⲁⲍⲉ ⲙⲙⲟϥ ϫⲉ ⲉⲩⲡⲉⲓⲣⲁⲍⲉ ⲙⲙⲟⲓ ⲉⲃⲟⲗ ϩⲓⲧⲙ ⲡⲛⲟⲩⲧⲉ ⲡⲛⲟⲩⲧⲉ ⲅⲁⲣ ⲙⲉϥⲡⲉⲓⲣⲁⲍⲉ ⲛⲗⲁⲁⲩ ⲉⲡⲡⲉⲑⲟⲟⲩ ⲙⲉϥⲡⲉⲓⲣⲁⲍⲉ ⲛⲧⲟϥ ⲛⲗⲁⲁⲩ ⲡⲟⲩⲁ ⲡⲟⲩⲁ ⲇⲉ ⲉⲩⲡⲉⲓⲣⲁⲍⲉ ⲙⲙⲟϥ ϩⲓⲧⲛ ⲧⲉϥⲉⲡⲓⲑⲩⲙⲓⲁ ⲙⲙⲓⲛ ⲙⲙⲟϥ ⲉⲩⲥⲱⲕ ⲙⲙⲟϥ ⲉⲩⲁⲡⲁⲧⲁ ⲙⲙⲟϥ ⲉⲓⲧⲁ ⲧⲉⲡⲓⲑⲩⲙⲓⲁ ⲁⲥⲱ ϣⲁⲥϫⲡⲟ ⲡⲛⲟⲃⲉ ⲡⲛⲟⲃⲉ ⲁϥϫⲱⲕ ⲉⲃⲟⲗ ⲁϥⲙⲓⲥⲉ ⲙⲡⲙⲟⲩ ⲡⲉⲣⲡⲗⲁⲛⲁ ⲛⲁⲥⲛⲏⲩ ⲛⲁⲙⲉⲣⲁⲧⲉ ϯⲛⲓⲙ ⲉⲧⲛⲁⲛⲟⲩϥ ⲁⲩⲱ ⲧⲇⲟⲣⲟⲛ ⲛⲓⲙ ⲉⲧϫⲏⲕ ⲉⲃⲟⲗ ⲟⲩⲉⲃⲟⲗ ϩⲙ ⲡⲡⲉ ⲡⲉ ⲉϥⲛⲏⲩ ⲉⲡⲉⲥⲏⲧ ϩⲓⲧⲙ ⲡⲉⲓⲱⲧ ⲛⲛⲉⲟⲩⲟⲉⲓⲛ ⲡⲁⲓ ⲉⲧ ⲙⲙⲛⲗⲁⲁⲩ ⲛϩⲁⲓⲃⲉⲥ ⲏ ϣⲓⲃⲉ ⲏ ⲣⲓⲕⲉ ϩⲁϩⲧⲏϥ ⲛⲧⲉⲣⲉϥⲟⲩⲱϣ ⲁϥϫⲡⲟ ⲙⲙⲟⲛ ϩⲙ ⲡϣⲁϫⲉ ⲛⲧⲙⲉ ⲉⲧⲣⲉϣⲱⲡⲉ ⲉⲩⲁⲩⲡⲁⲣⲭⲏ ⲛⲛⲉϥⲥⲱⲛⲧ ⲧⲉⲧⲛⲥⲟⲟⲩⲛ ⲇⲉ ⲛⲁⲥⲛⲏⲩ ⲛⲁⲙⲉⲣⲁⲧⲉ ⲙⲁⲣⲉϥϣⲱⲡⲉ ⲇⲉ ⲛϭⲓ ⲡⲣⲱⲙⲉ ⲛⲓⲙ ⲉϥϭⲉⲡⲏ ⲉⲥⲱⲧⲙ ⲉϥⲟⲥⲕ ⲉϣⲁϫⲉ ⲉϥϩⲟⲣϣ ⲛⲛⲟⲩϭⲥ ⲧⲟⲣⲅⲏ ⲅⲁⲣ ⲙⲡⲣⲱⲙⲉ ⲙⲉⲥⲣ ϩⲱⲃ ⲉⲇⲓⲕⲁⲓⲟⲥⲩⲛⲏ ⲙⲡⲛⲟⲩⲧⲉ ⲉⲧⲃⲉ ⲡⲁⲓ ⲁⲧⲉⲧⲛⲕⲱ ⲛⲥⲱⲧⲛ ⲛⲇⲱⲗⲙ ⲛⲓⲙ ⲙⲛ ⲕⲁⲕⲓⲁ ⲛⲓⲙ ϩⲣⲁⲓ ϩⲛ ⲟⲩⲙⲛⲧⲣⲙⲣⲁϣ ϣⲱⲡ ⲉⲣⲱⲧⲛ ⲙⲡϣⲁϫⲉ ⲛⲧⲙⲉ ⲡⲉⲧⲉ ⲟⲩⲛ ϭⲟⲙ ⲙⲙⲟϥ ⲉⲧⲟⲩϫⲟ ⲛⲛⲉⲧⲙⲯⲩⲭⲏ ϣⲱⲡⲉ ⲇⲉ ⲛⲣⲉϥⲉⲓⲣⲉ ⲙⲡϣⲁϫⲉ ⲁⲩⲱ ⲛⲣⲉϥⲥⲱⲧⲙ ⲙⲙⲁⲧⲉ ⲁⲛ ⲉⲧⲉⲧⲛⲡⲗⲁⲛⲁ ⲙⲙⲱⲧⲛ ϫⲉ ⲉϣⲱⲡⲉ ⲟⲩⲟⲛ ⲟⲩⲁ ⲟⲩⲣⲉϥⲥⲱⲧⲙ ⲉⲡϣⲁϫⲉ ⲡⲉ ⲉⲛⲟⲩⲣⲉϥⲉⲓⲣⲉ ⲙⲡϩⲱⲃ ⲁⲛ ⲡⲉ ⲡⲁⲓ ⲉϥⲧⲛⲧⲱⲛ ⲉⲩⲣⲱⲙⲉ ⲉϥⲛⲁⲩ ⲉⲡϩⲟ ⲛⲧⲁⲩϫⲡⲟϥ ⲛϩⲏⲧϥ ϩⲛ ⲟⲩⲉⲓⲁⲗ ⲁϥⲛⲁⲩ ⲅⲁⲣ ⲉⲣⲟϥ ⲁϥⲃⲱⲕ ⲁⲩⲱ ⲛⲧⲉⲩⲛⲟⲩ ⲁϥⲣ ⲡⲱⲃϣ ⲛⲑⲉ ⲉⲛⲉϥⲟ ⲙⲙⲟⲥ ⲡⲉⲛⲧⲁϥϭⲱϣⲧ ⲇⲉ ⲛⲧⲟϥ ⲉⲡⲛⲟⲙⲟⲥ ⲉⲧϫⲏⲕ ⲉⲃⲟⲗ ⲛⲧⲙⲛⲧⲣⲉⲙⲛϩⲉ ⲁϥϭⲱ ⲛϩⲏⲧϥ ⲛⲧⲁϥⲥⲱⲧⲙ ⲁⲛ ⲁϥⲣ ⲡⲱⲃϣ ⲁⲗⲗⲁ ⲛⲧⲁϥⲉⲓⲣⲉ ⲙⲡϩⲱⲃ ⲡⲁⲓ ϥⲛⲁϣⲱⲡⲉ ⲛⲁⲓⲁⲧϥ ⲉϩⲣⲁⲓ ϩⲙ ⲡⲉϥϩⲱⲃ ⲡⲉⲧϫⲱ ⲙⲙⲟⲥ ⲉⲣⲟϥ ϫⲉ ⲁⲛⲅ ⲟⲩⲣⲉϥϣⲙϣⲉ ⲛϥⲭⲁⲗⲓⲛⲟⲩ ⲁⲛ ⲙⲡⲉϥⲗⲁⲥ ⲁⲗⲗⲁ ⲉϥⲁⲡⲁⲧⲁ ⲙⲡⲉϥϩⲏⲧ ⲡⲁⲓ ⲡⲉϥϣⲙϣⲉ ϣⲟⲩⲉⲓⲧ ⲡϣⲙϣⲉ ⲇⲉ ⲉⲧⲟⲩⲁⲁⲃ ⲁⲩⲱ ⲉⲧⲟ ⲛⲛⲁⲇⲱⲗⲙ ⲛⲛⲁϩⲣⲙ ⲡⲛⲟⲩⲧⲉ ⲡⲉⲓⲱⲧ ⲡⲉ ⲡⲁⲓ ⲉϭⲙ ⲡϣⲓⲛⲉ ⲛⲛⲟⲣⲫⲁⲛⲟⲥ ⲙⲛ ⲛⲉⲭⲏⲣⲁ ϩⲣⲁⲓ ϩⲛ ⲛⲉⲩⲑⲗⲓⲯⲓⲥ ⲉⲧⲣⲉϥϩⲁⲣⲉϩ ⲉⲣⲟϥ ⲉⲇⲱⲗⲙ ϩⲙ ⲡⲕⲟⲥⲙⲟⲥ”

cltk_doc = cop_nlp.analyze(text=coptext)

print(type(coptext))

  1. See error (include literal copy-paste)
`CLTKException                             Traceback (most recent call last)
/var/folders/sk/lj2prx0d7fg_pbf1nsp15xsm0000gq/T/ipykernel_1373/3583250110.py in <module>
----> 1 cltk_doc = cop_nlp.analyze(text=coptext)`

`~/anaconda3/lib/python3.7/site-packages/cltk/nlp.py in analyze(self, text)
    140         for process in self.pipeline.processes:
    141             a_process = self._get_process_object(process)
--> 142             doc = a_process.run(doc)
    143         return doc
    144 `

`~/anaconda3/lib/python3.7/site-packages/cltk/dependency/processes.py in run(self, input_doc)
     51             input_text = output_doc.raw
     52         stanza_doc = stanza_wrapper.parse(input_text)
---> 53         cltk_words = self.stanza_to_cltk_word_type(stanza_doc)
     54         output_doc.words = cltk_words
     55         output_doc.stanza_doc = stanza_doc`

`~/anaconda3/lib/python3.7/site-packages/cltk/dependency/processes.py in stanza_to_cltk_word_type(stanza_doc)
    109                 cltk_features = [
    110                     from_ud(feature_name, feature_value)
--> 111                     for feature_name, feature_value in raw_features
    112                 ]
    113                 cltk_word.features = MorphosyntacticFeatureBundle(*cltk_features)`

`~/anaconda3/lib/python3.7/site-packages/cltk/dependency/processes.py in <listcomp>(.0)
    109                 cltk_features = [
    110                     from_ud(feature_name, feature_value)
--> 111                     for feature_name, feature_value in raw_features
    112                 ]
    113                 cltk_word.features = MorphosyntacticFeatureBundle(*cltk_features)`

`~/anaconda3/lib/python3.7/site-packages/cltk/morphology/morphosyntax.py in from_ud(feature_name, feature_value)
    451         else:
    452             raise CLTKException(
--> 453                 f"{value}: Unrecognized value for UD feature {feature_name}"
    454             )`

`CLTKException: Psor: Unrecognized value for UD feature Gender`

Expected behavior Output of print(type(coptext))should be <class 'cltk.core.data_types.Doc'> but I am running into the above mentioned error and the type remains str

** Additional information** If I just use one line of Coptic text, I do not run into an error but the analysis is not performed either, the text remains a str.

Desktop (please complete the following information):

  • MacOS 12.1 Monterey, CLTK 1.1 (engine) in a Jupyter Notebook in a virtual anaconda environment

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ESLinckecommented, Feb 11, 2022

Thank you so much, Kyle! It works now. I can tokenize, lemmatize, pos-tag. That’s really great!

0reactions
kylepjohnsoncommented, Feb 11, 2022

@ESLincke I have made a fix with #1153 and have pushed a new version to PyPI (v. 1.0.24). Please run again and let us know how it works.

Also, if you want to talk more about Coptic, please contact me by email. Your skill is rare 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create copy of process give error " VS1640105: Unrecognized ...
As title says, the “create copy of process” is giving the popular VS1640105 error when I attempt to copy a customized process.
Read more >
The School of Alexandria - Part I/Ch 4 - The Gnostics
W.H.C. Frend believes that gnosis held a worthy, if limited place, in the Jewish and the earliest Christian scales of values. "Knowing" God...
Read more >
7 Coptic and Ethiopic Historical Writing - Oxford Academic
Abstract. This chapter focuses on how the Christians of Egypt and Ethiopia were closely connected by ecclesiastical bonds for nearly 1700 years.
Read more >
A "Gospel of Jesus' Wife" on a Coptic Papyrus
Karen King of the Harvard Divinity School examines what she describes as "a new gospel." The text does not prove the existence of...
Read more >
The Lived Experiences of Married Immigrant Coptic Women in ...
It was through semi-structured interviews and open-ended questions that the interpretation of their experiences emerged. Each interview was ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found