相关疑难解决方法(0)

使用NLTK WordNet寻找合适的名词

有没有办法找到使用NLTK WordNet的专有名词?也就是说,我能用nltk Wordnet标记占有名词吗?

python nltk wordnet

26
推荐指数
1
解决办法
3万
查看次数

nltk:如何防止专有名词的堵塞

我正在尝试使用Stanford POS标记器和NER编写关键字提取程序.对于关键字提取,我只对专有名词感兴趣.这是基本方法

  1. 删除除字母之外的任何内容来清理数据
  2. 删除停用词
  3. 干每个字
  4. 确定每个单词的POS标签
  5. 如果POS标签是名词,则将其提供给NER
  6. 然后,NER将确定该单词是人,组织还是位置

示例代码

docText="'Jack Frost works for Boeing Company. He manages 5 aircraft and their crew in London"

words = re.split("\W+",docText) 

stops = set(stopwords.words("english"))

#remove stop words from the list
words = [w for w in words if w not in stops and len(w) > 2]

# Stemming
pstem = PorterStemmer()

words = [pstem.stem(w) for w in words]    

nounsWeWant = set(['NN' ,'NNS', 'NNP', 'NNPS'])

finalWords = []

stn = StanfordNERTagger('english.all.3class.distsim.crf.ser.gz') 
stp = StanfordPOSTagger('english-bidirectional-distsim.tagger') 

for …
Run Code Online (Sandbox Code Playgroud)

python nlp stemming nltk stanford-nlp

5
推荐指数
1
解决办法
1280
查看次数

标签 统计

nltk ×2

python ×2

nlp ×1

stanford-nlp ×1

stemming ×1

wordnet ×1