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

keyterms not available in version 0.5.0 #149

Closed
mosynaq opened this issue Dec 26, 2017 · 2 comments
Closed

keyterms not available in version 0.5.0 #149

mosynaq opened this issue Dec 26, 2017 · 2 comments

Comments

@mosynaq
Copy link

mosynaq commented Dec 26, 2017

Hi. After upgrading to version 0.5.0, I am unable to extract keyterms.

What I do:

import textacy
endoc=textacy.Doc(textacy.preprocess_text('''TEHRAN (FNA)- The Syrian Army and commanders of Al-Nusra Front (Tahrir al-Sham Hay'at or the Levant Liberation Board) are negotiating evacuation of the terrorists from the Southern countryside of Damascus city, a media outlet reported on Tuesday. The Arabic-language al-Etehad press quoted two well-informed sources as saying that Commander of Al-Nusra in Yarmouk Palestinian Refugee Camp Abu Bakr al-Amni and two of his aides have had a meeting with Colonel Talal al-Ali, one of the senior commanders of the Army, at the Patrolling Forces Building in Damascus on Wednesday to pave the way for the relocation of the remaining pockets of Al-Nusra fighters from the Southern countryside of Damascus city to Northern Syria. Al-Etehad further said that the Al-Nusra has been asked to hand over arms to the relevant officials, end military presence in Southern Syria in return for government amnesty for those who apply for pardoning to stay in the region. Al-Rijeh region and its nearby areas that are home to Al-Nusra militants are included in a truce agreement between the Syrian government, former Jeish al-Fatah and al-Nusra. The Arabic-language al-Watan daily quoted local sources as saying earlier this month that rifts and difference intensified among ISIL's commanders in recent days. The daily said that gaps went so deep among ISIL members and commanders in the town of Hajar al-Aswad and the Palestinian Yarmouk Refugee Camp in the Southern countryside of Damascus city that they defected and started independent organizations. Al-Watan further said that a number of ISIL fighters have escaped from the region towards other regions or surrendered to the Syrian Army troops.'''))
textacy.keyterms.textrank(endoc, n_keyterms=10)

What I get:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-709d60c77f28> in <module>()
----> 1 textacy.keyterms.textrank(endoc, n_keyterms=10)

AttributeError: module 'textacy' has no attribute 'keyterms'

Note that I have upgraded to textacy 0.5.0 with pip install textacy -U, receiving all updated deps.

Your Environment

  • textacy and spacy versions: 2.0.5, 0.5.0
  • Python version: 3.5, 2.7
  • Operating system and version: linux mint 18.2
@bdewilde
Copy link
Collaborator

Hi @mosynaq , that module is no longer imported at the top-level of the package; all you have to add is import textacy.keyterms to let Python know what you're referring to.

@mosynaq
Copy link
Author

mosynaq commented Dec 28, 2017

Thanks! It works again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants