AlchemyNews API多个关联性分数工作不正常



当使用1个以上时,相关性得分参数似乎不起作用。换句话说。。。我基本上想得到概念和关键词都是相关性得分=>0.8的广告文章。此外,使用相关性得分=>0.8的广告分类法。这是查询,我将参数分开,以便于阅读。

https://access.alchemyapi.com/calls/data/GetNews?apikey=APIKEY&start=now-7d&end=now&outputMode=json&return=enriched.url.url,enriched.url.title,enriched.url.taxonomy,enriched.url.keywords,enriched.url.concepts
&q.enriched.url.concepts.concept.text=advertising
&q.enriched.url.concepts.concept.relevance=>0.8
&q.enriched.url.taxonomy.taxonomy_.label=business and industrial/advertising and marketing/advertising
&q.enriched.url.taxonomy.taxonomy_.score=>0.8
&q.enriched.url.keywords.keyword.text=advertising
&q.enriched.url.keywords.keyword.relevance=>0.8
&q.enriched.url.title=O-[jobs^job]
&q.enriched.url.title=O-[careers^career]
&q.enriched.url.title=O-[cv^resume]
&dedup=1
&rank=high^medium

我得到的文章结果具有相关性得分低于"0.8"的"furiched.ul.concepts.concept.text=advertising"和/或相关性得分低于"0.8"的"furyed.ul.taxonomy.taxonomy_.label=business-and-industry/advertising-and-marketing/addinging"。例如,结果中的文章"最大化用户广告体验的4个技巧"非常好,因为它满足了所有3个需要相关性分数的参数(例如相关性分数>=0.8)

"concepts": [
                                    "relevance": 0.974825978,
                                    "text": "Advertising"
                                },
"keywords": [
                                {
                                    "knowledgeGraph": {
                                        "typeHierarchy": "/services/mobile advertising"
                                    },
                                    "relevance": 0.910649002,
                                    "sentiment": {
                                        "mixed": 0,
                                        "score": 0,
                                        "type": "neutral"
                                    },
                                    "text": "mobile advertising"
                                }
"taxonomy": [
                                {
                                    "confident": "",
                                    "label": "/business and industrial/advertising and marketing/advertising",
                                    "score": 0.991141975
                                }

然而,这是大多数结果的一个例子,它不符合或只符合其中一个相关性分数:

"concepts": [{
                                    "relevance": 0.447964013,
                                    "text": "Advertising"
                                }
"keywords": [{
                                    "knowledgeGraph": {
                                        "typeHierarchy": "/people/users/third parties/advertisers"
                                    },
                                    "relevance": 0.623048007,
                                    "sentiment": {
                                        "mixed": 1,
                                        "score": -0.291121989,
                                        "type": "negative"
                                    },
                                    "text": "advertisers"
                                }
"taxonomy": [
                                 {
                                    "confident": "no",
                                    "label": "/business and industrial/advertising and marketing/advertising",
                                    "score": 0.345863998
                                }

我最终希望查询只返回像第一个例子一样的结果,其中它满足所有3个标准(例如相关性得分>=0.8)。有人能调查一下吗?查询有问题吗?谢谢

Dennis:您在处理URL参数时似乎遇到了错误。该解决方案需要紧凑地重新格式化参数,但这是复杂URL的首选格式。

例如,不要像这样发送参数:

q.enriched.url.concepts.concept.text=Advertising
q.enriched.url.concepts.concept.relevance=>0.80
q.enriched.url.taxonomy.taxonomy_.score=>0.8
q.enriched.url.taxonomy.taxonomy_.label=business and industrial/advertising and marketing/advertising
q.enriched.url.keywords.keyword.text=Advertising
q.enriched.url.keywords.keyword.relevance=>0.80

您会将它们分组:

q.enriched.url.concepts.concept=|text=Advertising,relevance=>0.80|
q.enriched.url.taxonomy.taxonomy_=|score=>0.8,label=business and industrial/advertising and marketing/advertising|
q.enriched.url.keywords.keyword=|text=Advertising,relevance=>0.80|

所以这个最终URL对我有效:

https://access.alchemyapi.com/calls/data/GetNews?q.enriched.url.concepts.concept=|text=Advertising,relevance=>0.80|&q.enriched.url.keywords.keyword=|text=advertising,relevance=>=.8|&q.enriched.url.taxonomy.taxonomy_=|label=business and industrial/advertising and marketing/advertising,score=>=.8|&return=enriched.url.url,enriched.url.title,enriched.url.concepts,enriched.url.taxonomy.taxonomy_,enriched.url.keywords&apikey=APIKEY&start=now-7d&end=now&outputMode=json&q.enriched.url.title=O-[jobs^job]&q.enriched.url.title=O-[careers^career]&q.enriched.url.title=O-[cv^resume]&dedup=1&rank=high^medium

相关内容

  • 没有找到相关文章

最新更新