[2d4573]: / QueryExtraction / gensim_test_query.py

Download this file

16 lines (9 with data), 276 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
'''
Based on TextRank
https://radimrehurek.com/gensim_3.8.3/summarization/summariser.html
'''
import gensim
from gensim.summarization import keywords
def gensim_extract(test_free_text,ratio=0.3):
result = keywords(test_free_text,ratio)
return result.split('\n')