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

Run the demo and nothing printed #69

Open
mknee40 opened this issue Jul 13, 2022 · 2 comments
Open

Run the demo and nothing printed #69

mknee40 opened this issue Jul 13, 2022 · 2 comments

Comments

@mknee40
Copy link

mknee40 commented Jul 13, 2022

I did all the setup as explained, but when I run the python file nothing is printed to the terminal? What did I do wrong.

from rake_nltk import Rake

# Uses stopwords for english from NLTK, and all puntuation characters by
# default
r = Rake()

mytext = '''
Black-on-black ware is a 20th- and 21st-century pottery tradition developed by the Puebloan Native American ceramic artists in Northern New Mexico. Traditional reduction-fired blackware has been made for centuries by pueblo artists. Black-on-black ware of the past century is produced with a smooth surface, with the designs applied through selective burnishing or the application of refractory slip. Another style involves carving or incising designs and selectively polishing the raised areas. For generations several families from Kha'po Owingeh and P'ohwhóge Owingeh pueblos have been making black-on-black ware with the techniques passed down from matriarch potters. Artists from other pueblos have also produced black-on-black ware. Several contemporary artists have created works honoring the pottery of their ancestors.
'''

# Extraction given the text.
r.extract_keywords_from_text(mytext)

# Extraction given the list of strings where each string is a sentence.
#r.extract_keywords_from_sentences(<list of sentences>)

# To get keyword phrases ranked highest to lowest.
r.get_ranked_phrases()

# To get keyword phrases ranked highest to lowest with scores.
r.get_ranked_phrases_with_scores()
@joaquinmenendez
Copy link

The output I got
[(22.75, 'puebloan native american ceramic artists'), (16.0, 'another style involves carving'), (13.5, 'century pottery tradition developed'), (9.0, 'northern new mexico'), (9.0, 'generations several families'), (9.0, 'created works honoring'), (8.75, 'several contemporary artists'), (7.5, 'ohwhóge owingeh pueblos'), (6.875, 'also produced black'), (5.0, 'past century'), (4.75, 'pueblo artists'), (4.5, 'po owingeh'), (4.0, 'traditional reduction'), (4.0, 'techniques passed'), (4.0, 'smooth surface'), (4.0, 'selectively polishing'), (4.0, 'selective burnishing'), (4.0, 'refractory slip'), (4.0, 'raised areas'), (4.0, 'matriarch potters'), (4.0, 'incising designs'), (4.0, 'fired blackware'), (4.0, 'designs applied'), (3.875, 'making black'), (3.875, 'black ware'), (3.875, 'black ware'), (3.875, 'black ware'), (3.875, 'black ware'), (2.75, 'artists'), (2.5, 'pottery'), (2.0, 'pueblos'), (2.0, 'produced'), (1.875, 'black'), (1.875, 'black'), (1.0, 'p'), (1.0, 'made'), (1.0, 'kha'), (1.0, 'centuries'), (1.0, 'application'), (1.0, 'ancestors'), (1.0, '21st'), (1.0, '20th')]

@joaquinmenendez
Copy link

run the last command alone

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