换句话说,如果我向提交一个HTML文档,并且将文档类型指定为HTML而不是PLAIN_TEXT,那么它是否会影响Google分解句子的方式?
例如:
<h3>Wholemeal pasta</h3> <p>They are absolutely amazing.</p>这是否被视为:
Wholemeal pasta They are absolutely amazing.或者更多的两句话:
Wholemeal pasta. They are absolutely amazing.如果有人知道的话,太好了。
发布于 2018-01-29 12:37:55
中的文件类型是一个确定正在处理的文本类型的字段。它主要是将PLAIN_TEXT文档和HTML文档区分开来,这实际上将解释文档的格式,以便在分析内容时获得更好的结果。
然后,使用您共享的示例( <h3>Wholemeal pasta</h3> <p>They are absolutely amazing.</p> ),只需对API运行一些示例查询,就可以证明,如果将该文本标记为HTML,该API将作为两个独立句子处理该文本。
下面我使用两种不同的文档类型共享运行查询的结果(通过API资源管理器):
·文本文档类型:只有一个句子被处理,其中有sentiment.magnitude = 0.9和sentiment.score = 0.9
{
"documentSentiment": {
"magnitude": 0.9,
"score": 0.9
},
"language": "en",
"sentences": [
{
"text": {
"content": "<h3>Wholemeal pasta</h3> <p>They are absolutely amazing.</p>",
"beginOffset": -1
},
"sentiment": {
"magnitude": 0.9,
"score": 0.9
}
}
]
}·使用HTML文档类型:用sentiment.magnitude = 0.1和sentiment.score = 0.1处理两个句子,然后是sentiment.magnitude = 0.9和sentiment.score = 0.9
{
"documentSentiment": {
"magnitude": 1.1,
"score": 0.5
},
"language": "en",
"sentences": [
{
"text": {
"content": "Wholemeal pasta",
"beginOffset": -1
},
"sentiment": {
"magnitude": 0.1,
"score": 0.1
}
},
{
"text": {
"content": "They are absolutely amazing.",
"beginOffset": -1
},
"sentiment": {
"magnitude": 0.9,
"score": 0.9
}
}
]
}让我还向您推荐API资源管理器工具,以便测试您想要使用的任何Google的功能。
https://stackoverflow.com/questions/48500807
复制相似问题