Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible float value in EFO #49

Closed
masarunakajima opened this issue May 22, 2024 · 3 comments · Fixed by #50
Closed

Possible float value in EFO #49

masarunakajima opened this issue May 22, 2024 · 3 comments · Fixed by #50
Labels
bug Something isn't working

Comments

@masarunakajima
Copy link

Running
df1 = text2term.map_terms("test/unstruct_terms.txt", "http://www.ebi.ac.uk/efo/efo.owl")
Gave me an error which is something like

.....
  File "/MY_PATH_TO/text2term/tfidf_mapper.py", line 50, in _tokenize
    vocabulary = count_vectorizer.fit(source_terms + target_labels).vocabulary_
....
  File "/MY_PATH_TO/sklearn/feature_extraction/text.py", line 69, in _preprocess
    doc = doc.lower()
          ^^^^^^^^^
AttributeError: 'float' object has no attribute 'lower'

The problem seems to be caused by giving count_vectorizer.fit a list including a float.
I guess a float value is somewhere in EFO.
Changing the above code to
df1 = text2term.map_terms("test/unstruct_terms.txt", "http://purl.obolibrary.org/obo/cl.owl")
worked.

@tomarashish
Copy link

Changing the line 69 in file /MY_PATH_TO/sklearn/feature_extraction/text.py to doc = str(doc).lower() worked

@rsgoncalves
Copy link
Contributor

Thank you for reporting.

There is indeed a bug in the t2t input handler, which throws this error when an ontology term label or synonym is not a string. In this case, there is a synonym 92.1 for a term in EFO that is causing the issue.

A bug fix will be released, either today or tomorrow, to address this issue.

@rsgoncalves rsgoncalves added the bug Something isn't working label Jun 3, 2024
@rsgoncalves
Copy link
Contributor

This issue should no longer occur in the latest release v4.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants