如何从包括数字在内的文本中提取重要的关键字?

2024-09-30 16:30:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用词干分析和NLP方法从文本文件中提取关键字。在

我得到了输出关键字:

keywords = ['the lounge lizards', 'jazz', 'john lurie', 'musical', 'albums', 'bass guitar', 'drums', 'edit', 'erik satie', 'erik sanko']

# now to get numeric significant keywords 
# Applied this reg ex 
re.findall(r'\w+\s\d+.*?\s\w+', content)

numeric_keywords = ['in 1978 by', 'History\n2 Past', 'members\n3 Discography',    'albums\n3.2 Live', 'June 4th, 1979', 'October 7,1986): "The Lounge', 'In 1984 the', 'early 1990s; prominent']

有没有更好的方法来提取数字?两个输出都来自同一个文件。在


Tags: the方法nlp关键字john文本文件keywordsnumeric