主要内容

Japanese Language Support

This topic summarizes the Text Analytics Toolbox™ features that support Japanese text. For an example showing how to analyze Japanese text data, seeAnalyze Japanese Text Data

Tokenization

The象征性文档function automatically detects Japanese input. Alternatively, set the'Language'option in象征性文档to'ja'。此选项指定令牌的语言详细信息。要查看令牌的语言细节,请使用tokenDetailsThese language details determine the behavior of theremoveStopWords,AddPartofSpeechDetails,normalizeWords,addSentenceDetails, 和addEntityDetails在令牌上的功能。

To specify additional MeCab options for tokenization, create amecaboptionsobject. To tokenize using the specified MeCab tokenization options, use the'TokenizeMethod'option of象征性文档

Tokenize Japanese Text

Tokenize Japanese text using象征性文档。该功能自动检测日语文本。

str = ["恋に悩み、苦しむ。"“恋ので。”“空にが,瞬いいる。”"空の星が輝きを増している。"];文档= tokenizedDocument(str)
documents = 4x1 tokenizedDocument: 6 tokens: 恋 に 悩み 、 苦しむ 。 6 tokens: 恋 の 悩み で 苦しむ 。 10 tokens: 空 に 星 が 輝き 、 瞬い て いる 。 10 tokens: 空 の 星 が 輝き を 増し て いる 。

语音细节的一部分

ThetokenDetailsfunction, by default, includes part of speech details with the token details.

Get Part of Speech Details of Japanese Text

Tokenize Japanese text using象征性文档

str = ["恋に悩み、苦しむ。""恋の悩みで 苦しむ。"“空にが,瞬いいる。”"空の星が輝きを増している。"“駅まで远く,歩け。”“远くのまでない”“すももももももももの。”];文档= tokenizedDocument(str);

For Japanese text, you can get the part-of-speech details usingtokenDetails。For English text, you must first useAddPartofSpeechDetails

tdetails = tokendetails(文档);头(tdetails)
ans=8×8桌Token DocumentNumber LineNumber Type Language PartOfSpeech Lemma Entity _______ ______________ __________ ___________ ________ ____________ _______ __________ "恋" 1 1 letters ja noun "恋" non-entity "に" 1 1 letters ja adposition "に" non-entity "悩み" 1 1 letters ja verb "悩む" non-entity "、" 1 1 punctuation ja punctuation "、" non-entity "苦しむ" 1 1 letters ja verb "苦しむ" non-entity "。" 1 1 punctuation ja punctuation "。" non-entity "恋" 2 1 letters ja noun "恋" non-entity "の" 2 1 letters ja adposition "の" non-entity

命名实体识别

ThetokenDetailsfunction, by default, includes entity details with the token details.

Add Named Entity Tags to Japanese Text

Tokenize Japanese text using象征性文档

str = [“マリーさんからニューヨーク引っ越しまし。”"駅で鈴木さんに迎えに行きます。""東京は大阪より大きいですか?""東京に行った時、新宿や渋谷などいろいろな所を訪れました。"];文档= tokenizedDocument(str);

For Japanese text, the software automatically adds named entity tags, so you do not need to use theaddEntityDetails功能。This software detects person names, locations, organizations, and other named entities. To view the entity details, use thetokenDetails功能。

tdetails = tokendetails(文档);头(tdetails)
ans=8×8桌Token DocumentNumber LineNumber Type Language PartOfSpeech Lemma Entity ____________ ______________ __________ _______ ________ ____________ ____________ __________ "マリー" 1 1 letters ja proper-noun "マリー" person "さん" 1 1 letters ja noun "さん" person "は" 1 1 letters ja adposition“は”非实体“ボストン” 1 1个字母ja porpor-noun“ location” location“ location” location'から“ 1 1个字母ja adposition” non-endity“ n​​on-endity”ニューヨーク“ 1 1个字母ja porth ja porter-noun“ location” location'“ 1 1个字母Ja adposition”に“非实体”引っ越し” 1 1个字母JA动词“引っ越す”非实体

View the words tagged with entity"person","location",“组织”, or"other"。这些单词是未标记的单词"non-entity"

idx = tdetails.Entity ~="non-entity";tdetails(idx,:)。令牌
ans =11x1 string“マリー”“さん”“ボストン”“ニューヨーク”“铃木”“”“さん”“东京”“大阪”“”“东京”“新宿”“渋谷”。

Stop Words

要根据令牌语言详细信息从文档中删除停止单词,请使用removeStopWords。For a list of Japanese stop words set the'Language'option in停止字to'ja'

Remove Japanese Stop Words

Tokenize Japanese text using象征性文档。该功能自动检测日语文本。

str = [“ここはな,とてもです”"企業内の顧客データを利用し、今年の売り上げを調べることが出来た。""私は先生です。私は英語を教えています。"];文档= tokenizedDocument(str);

Remove stop words usingremoveStopWords。The function uses the language details fromdocuments确定哪种语言停止单词要删除。

文档= removestopwords(文档)
documents = 3x1 tokenizedDocument: 4 tokens: 静か 、 とても 穏やか 10 tokens: 企業 顧客 データ 利用 、 今年 売り上げ 調べる 出来 。 5 tokens: 先生 。 英語 教え 。

Lemmatization

To lemmatize tokens according to the token language details, usenormalizeWords和set the'Style'选项'lemma'

Lemmatize Japanese Text

Tokenize Japanese text using the象征性文档功能。该功能自动检测日语文本。

str = [“空にが,瞬いいる。”"空の星が輝きを増している。"“駅まで远く,歩け。”“远くのまでない”];文档= tokenizedDocument(str);

使用代币使用normalizeWords

documents = normalizeWords(documents)
documents = 4x1 tokenizedDocument: 10 tokens: 空 に 星 が 輝く 、 瞬く て いる 。 10 tokens: 空 の 星 が 輝き を 増す て いる 。 9 tokens: 駅 まで は 遠い て 、 歩ける ない 。 7 tokens: 遠く の 駅 まで 歩ける ない 。

独立于语言的功能

Word and N-Gram Counting

ThebagOfWordsbagOfNgramsfunctions support象征性文档输入不论语言如何。如果你有象征性文档包含数据的数组,然后您可以使用这些功能。

建模和预测

Thefitldafitlsafunctions supportbagOfWordsbagOfNgrams输入不论语言如何。如果你有bagOfWords或者bagOfNgramsobject containing your data, then you can use these functions.

ThetrainWordEmbeddingfunction supports象征性文档无论语言或文件输入。如果你有象征性文档array or a file containing your data in the correct format, then you can use this function.

See Also

|||||||

相关话题