Main Content

テキスト データの準備

テキスト データを MATLAB® にインポートして、解析のために前処理する

Text Analytics Toolbox™ には、装置のログ、ニュース フィード、アンケート、オペレーター レポート、ソーシャル メディアなどのソースから得た生テキストを処理するためのツールが含まれます。これらのツールを使用して、一般的なファイル形式からテキストを抽出し、生テキストを前処理し、個々の単語またはマルチワード フレーズ (n-gram) を抽出し、テキストを数値表現に変換し、統計モデルを構築します。開始方法を示す例については、解析用のテキスト データの準備を参照してください。

Text Analytics Toolbox は、英語、日本語、ドイツ語、および韓国語の言語をサポートしています。Text Analytics Toolbox のほとんどの関数は、他の言語のテキストでも動作します。詳細については、言語に関する考慮事項を参照してください。

ライブ エディター タスク

テキスト データの前処理Preprocess and clean up text data for analysis (R2023a 以降)

関数

すべて展開する

extractFileTextPDF、Microsoft Word、HTML、およびプレーン テキスト ファイルからのテキストの読み取り
extractHTMLTextHTML からのテキストの抽出
readPDFFormDataPDF フォームからのデータの読み取り
pdfinfoPDF file information (R2023a 以降)
writeTextDocumentテキスト ファイルへの文書の書き込み
htmlTree解析された HTML ツリー
findElementHTML ツリー内の要素の検出
getAttributeHTML ツリーのルート ノードの HTML 属性の読み取り
ismissingFind HTML trees without values
stringConvert parsed HTML tree to string
tokenizedDocumentテキスト解析用のトークン化された文書の配列
erasePunctuationテキストや文書からの句読点の消去
eraseTagsテキストからの HTML および XML のタグの消去
eraseURLsテキストからの HTTP および HTTPS の URL の消去
removeStopWords文書からのストップ ワードの削除
removeShortWords文書または bag-of-words モデルからの短い単語の削除
removeLongWordsRemove long words from documents or bag-of-words model
removeWords文書または bag-of-words モデルからの選択単語の削除
normalizeWords単語のステミングまたはレンマ化
replaceWordsReplace words in documents
replaceNgramsReplace n-grams in documents
splitSentencesSplit text into sentences
splitParagraphsSplit text into paragraphs (R2023a 以降)
stopWordsストップ ワードのリスト
decodeHTMLEntitiesHTML および XML のエンティティから文字への変換
lower小文字への文書の変換
upper大文字への文書の変換
contextSearch documents for word or n-gram occurrences in context
tokenDetailsDetails of tokens in tokenized document array
addSentenceDetailsAdd sentence numbers to documents
addPartOfSpeechDetailsAdd part-of-speech tags to documents
addLemmaDetailsAdd lemma forms of tokens to documents
addLanguageDetailsAdd language identifiers to documents
addEntityDetailsAdd entity tags to documents
addDependencyDetails文書への文法的依存関係の詳細の追加 (R2022b 以降)
addTypeDetailsAdd token type details to documents
splitSentencesSplit text into sentences
splitParagraphsSplit text into paragraphs (R2023a 以降)
corpusLanguageテキストの言語の検出
abbreviations一般的な略語の table
topLevelDomainsトップレベル ドメインのリスト
bagOfWordsbag-of-words モデル
bagOfNgramsbag-of-n-grams モデル
addDocumentAdd documents to bag-of-words or bag-of-n-grams model
removeDocumentRemove documents from bag-of-words or bag-of-n-grams model
removeInfrequentWordsbag-of-words モデルからカウント数の少ない単語を削除する
removeInfrequentNgramsRemove infrequently seen n-grams from bag-of-n-grams model
removeNgramsRemove n-grams from bag-of-n-grams model
removeEmptyDocumentsRemove empty documents from tokenized document array, bag-of-words model, or bag-of-n-grams model
topkwordsMost important words in bag-of-words model or LDA topic
topkngramsMost frequent n-grams
encodeEncode documents as matrix of word or n-gram counts
tfidf単語頻度-逆文書頻度 (tf-idf) 行列
joinCombine multiple bag-of-words or bag-of-n-grams models
correctSpellingCorrect spelling of words (R2020a 以降)
editDistanceFind edit distance between two strings or documents
editDistanceSearcherEdit distance nearest neighbor searcher
knnsearch編集距離による最近傍の検出
rangesearchFind nearest neighbors by edit distance range
splitGraphemesSplit string into graphemes
docfunApply function to words in documents
containsWordsCheck if word is member of documents (R2022b 以降)
containsNgramsCheck if n-gram is member of documents (R2022a 以降)
containsCheck if pattern is substring in documents (R2022b 以降)
plusAppend documents
replaceReplace substrings in documents
regexprepReplace text in words of documents using regular expression
doclength文書配列内の文書の長さ
doc2cell文書から string ベクトルの cell 配列への変換
joinWords単語連結による文書から string への変換
stringスカラー文書から string ベクトルへの変換
textanalytics.unicode.nfcUnicode composed normalized form (NFC) (R2022b 以降)
textanalytics.unicode.nfdUnicode decomposed normalized form (NFD) (R2021a 以降)
textanalytics.unicode.nfkcUnicode compatibility composed normalized form (NFKC) (R2022b 以降)
textanalytics.unicode.nfkdUnicode compatibility decomposed normalized form (NFKD) (R2022b 以降)
textanalytics.unicode.UTF32Unicode UTF-32 string representation (R2021a 以降)
characterCategoriesUnicode character categories (R2021a 以降)
hexUTF-32 表現から 16 進数値への変換 (R2021a 以降)
stringUTF-32 表現から string への変換 (R2021a 以降)

トピック

インポート

前処理

言語サポート