Skip to content

Commit

Permalink
python code
Browse files Browse the repository at this point in the history
  • Loading branch information
kavos113 committed Aug 18, 2024
1 parent 54afd61 commit 36f9606
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/tag/keytest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import pke
9 changes: 9 additions & 0 deletions src/tag/keyword.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import pke

extractor = pke.unsupervised.TopicRank()

def keyword_extract(text, n):
extractor.load_document(input=text, language='ja')
extractor.candidate_selection(pos={'NOUN', 'PROPN'})
extractor.candidate_weighting()
return extractor.get_n_best(n=n)

0 comments on commit 36f9606

Please sign in to comment.