![](/img/trans.png)
[英]Error in finding string of words that are present in one column is also present in another or not?
[英]How to get count of words in a document which is already present in another file?
我在文本挖掘領域工作並且是新手。 我是一個文件,其中包含一個單詞列表及其相應的權重,如下所示:
Malfunction Weight
malformed 1
unformed 0.9
intensive 0.8
malfunctioned 0.7
front 0.6
icu 0.5
injury 0.4
care 0.3
disease 0.2
diagnosis 0.1
現在我想用文檔檢查列表中的每個單詞,並檢索文檔中每個術語的出現次數。 任何人都可以告訴如何在 R 中做同樣的事情嗎?
我已經使用了 tm 包,但我不想做術語文檔矩陣。 首先我需要找到與上面匹配的單詞,然后我需要找到這些單詞在每個文檔中出現的次數
如果你需要更基本的介紹,我推薦這本書
如果你只想數這十個詞,你可以使用:
length(document.words.v[which(document.words.v=="malformed")])
對於每個單詞
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.