Main Content

添加性etails.

将实体标记添加到文档

描述

Use添加性etails.将实体标记添加到文档。

Use添加性etails.检测文本中的人名,位置,组织和其他命名实体。这个过程被称为命名实体认可

The function supports English, Japanese, German, and Korean text.

例子

更新录容= AddEntityDetails(文件的)detects the named entities in文件。The function adds details to the tokens with missing entity details only. To get the entity details from更新录容那use令敬当

更新录容= AddEntityDetails(文件名称,价值的)还使用一个或多个名称值对指定其他选项。

提示

Use添加性etails.在使用之前降低正常化字删除那andRemovestopwords.functions as添加性etails.使用这些功能删除的信息。

例子

全部收缩

Create a tokenized document array.

str = [“玛丽搬到马萨诸塞州的纳尼克。”"John uses MATLAB at MathWorks."];文档=令授权鳕(str);

使用使用的文档将实体详细信息添加到文档中添加性etails.功能。此函数检测文本中的命名实体,并将详细信息添加到返回的表中令敬当功能。View the updated token details of the first few tokens.

文档= AddEntityDetails(文件);tdetails = tokenDetails(documents)
tdetails=13×8表Token DocumentNumber SentenceNumber LineNumber Type Language PartOfSpeech Entity _______________ ______________ ______________ __________ ___________ ________ ____________ ____________ "Mary" 1 1 1 letters en proper-noun person "moved" 1 1 1 letters en verb non-entity "to" 1 1 1 letters en adposition non-entity "Natick" 1 1 1 letters en proper-noun location "," 1 1 1 punctuation en punctuation non-entity "Massachusetts" 1 1 1 letters en proper-noun location "." 1 1 1 punctuation en punctuation non-entity "John" 2 1 1 letters en proper-noun person "uses" 2 1 1 letters en verb non-entity "MATLAB" 2 1 1 letters en proper-noun other "at" 2 1 1 letters en adposition non-entity "MathWorks" 2 1 1 letters en proper-noun organization "." 2 1 1 punctuation en punctuation non-entity

查看标记为实体的单词“人”"location""organization", 要么“其他”。这些词是未标记的单词“非实体”

idx = tdetails.entity〜=“非实体”; tdetails.Token(idx)
ANS =.6x1字符串"Mary" "Natick" "Massachusetts" "John" "MATLAB" "MathWorks"

使用授权日语文本tokenizedDocument

str = ["マリーさんはボストンからニューヨークに引っ越しました。""駅で鈴木さんに迎えに行きます。"“东莞は大厦より大厦ですか?”“东京に行っ时,新闻や渋谷などいろいろな所访れました。”];文档=令授权鳕(str);

对于日文文本,软件会自动添加命名实体标记,因此您无需使用该标记添加性etails.功能。该软件检测人员名称,位置,组织和其他命名实体。要查看实体详细信息,请使用令敬当功能。

tdetails = tokenDetails(documents); head(tdetails)
ANS =.8×8 tableToken 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 "は" non-entity "ボストン" 1 1 letters ja proper-noun "ボストン" location "から" 1 1 letters ja adposition "から" non-entity "ニューヨーク" 1 1 letters ja proper-noun "ニューヨーク" location "に" 1 1 letters ja adposition "に" non-entity "引っ越し" 1 1 letters ja verb "引っ越す" non-entity

查看标记为实体的单词“人”"location""organization", 要么“其他”。These words are the words not tagged“非实体”

idx = tdetails.entity〜=“非实体”; tdetails(idx,:).Token
ANS =.11x1字符串"マリー" "さん" "ボストン" "ニューヨーク" "鈴木" "さん" "東京" "大阪" "東京" "新宿" "渋谷"

Tokenize German text usingtokenizedDocument

str = [“Ernst Zog Von Frankfurt Nach Berlin。”"Besuchen Sie Volkswagen in Wolfsburg."];文档=令授权鳕(str);

To add entity tags to German text, use the添加性etails.功能。此功能检测人员名称,位置,组织和其他命名实体。

文档= AddEntityDetails(文件);

要查看实体详细信息,请使用令敬当功能。

tdetails = tokenDetails(documents); head(tdetails)
ANS =.8×8 tabletoken documentnumber sendengenumber linenumber型语言partofspeech实体___________ ____________________________________________________tress de brong nounity“von”字母De Adposition none--entity“法兰克福”1 1 1 1字母De Perfice-noun位置“Nach”1 1 1 1 1字母De Adposition非实体“Berlin”1 1 1字母De Perfice-noun位置“。”1 1 1标点符号标点符号非实体“BESUCHEN”2 1 1字母DE VERB非实体

查看标记为实体的单词“人”"location""organization", 要么“其他”。这些词是未标记的单词“非实体”

idx = tdetails.entity〜=“非实体”; tdetails(idx,:)
ANS =.5×8 tableToken DocumentNumber SentenceNumber LineNumber Type Language PartOfSpeech Entity ____________ ______________ ______________ __________ _______ ________ ____________ ____________ "Ernst" 1 1 1 letters de proper-noun person "Frankfurt" 1 1 1 letters de proper-noun location "Berlin" 1 1 1 letters de proper-noun location "Volkswagen" 2 1 1 letters de noun organization "Wolfsburg" 2 1 1 letters de proper-noun location

输入参数

全部收缩

输入文档,指定为atokenizedDocument大批。

名称值对参数

指定可选的逗号分离对名称,价值arguments.姓名是参数名称和Valueis the corresponding value.姓名必须出现在引号。你可以specify several name and value pair arguments in any order as姓名1,Value1,...,NameN,ValueN

Example:'DiscardKnownValues',真实specifies to discard previously computed details and recompute them.

将文档退回的方法,指定为以下内容之一:

  • '实体'– Transform the tokens for named entity recognition. The function merges tokens from the same entity into a single token.

  • '没有'– Do not retokenize the documents.

丢弃先前计算的详细信息并重新计算,指定为trueor错误的

数据类型:逻辑

输出参数

全部收缩

更新的文件,返回A.tokenizedDocument大批。从...获得令牌细节更新录容那use令敬当

Algorithms

全部收缩

语言细节

tokenizedDocumentobjects contain details about the tokens including language details. The language details of the input documents determine the behavior of添加性etails.。ThetokenizedDocumentfunction, by default, automatically detects the language of the input text. To specify the language details manually, use the'语言'name-value pair argument oftokenizedDocument。要查看令牌详细信息,请使用令敬当功能。

在R2019A引入