MATLAB ヘルプ センター
文書または bag-of-words モデルからの短い単語の削除
newDocuments = removeShortWords(documents,len)
newBag = removeShortWords(bag,len)
newDocuments = removeShortWords(documents,len) は、長さが len 以下の単語を documents から削除します。
newDocuments
documents
len
例
newBag = removeShortWords(bag,len) は、長さが len 以下の単語を bagOfWords オブジェクト bag から削除します。
newBag
bag
bagOfWords
すべて折りたたむ
文書から 2 文字以下の単語を削除します。
document = tokenizedDocument("An example of a short sentence"); newDocument = removeShortWords(document,2)
newDocument = tokenizedDocument: 3 tokens: example short sentence
bag-of-words モデルから 2 文字以下の単語を削除します。
documents = tokenizedDocument([ ... "an example of a short sentence" "a second short sentence"]); bag = bagOfWords(documents); newBag = removeShortWords(bag,2)
newBag = bagOfWords with properties: NumWords: 4 Counts: [2×4 double] Vocabulary: ["example" "short" "sentence" "second"] NumDocuments: 2
tokenizedDocument
入力文書。tokenizedDocument 配列として指定します。
入力の bag-of-words モデル。bagOfWords オブジェクトとして指定します。
削除する単語の最大長。正の整数として指定します。この関数は、len 文字以下の単語を削除します。
出力文書。tokenizedDocument 配列として返されます。
出力の bag-of-words モデル。bagOfWords オブジェクトとして返されます。
R2017b で導入
removeWords | stopWords | removeLongWords | normalizeWords | tokenizedDocument | bagOfWords | bagOfNgrams
removeWords
stopWords
removeLongWords
normalizeWords
bagOfNgrams
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
ヨーロッパ
アジア太平洋地域
最寄りの営業オフィスへのお問い合わせ