AlchemyNews API 多个相关性分数无法正常工作

AlchemyNews API multiple relevance scores not working properly

当使用超过 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

我得到的文章结果包含“enriched.url.concepts.concept.text=广告”,相关性得分低于“0.8”and/or“enriched.url.taxonomy.taxonomy_.label=商业和industrial/advertising并且marketing/advertising”,相关性得分低于“0.8”。例如,搜索结果中的文章“4 Tips for Maximizing the User's Advertising Experience”是优秀的,因为它满足了所有 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
                                }

但是,这是大多数结果的示例,满足 none 或仅满足其中一个相关性分数:

"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
                                }

我最终希望查询只有 return 结果,就像第一个满足所有 3 个标准的示例(例如,相关性分数 > = 0.8)。有人可以调查一下吗?查询有问题吗?谢谢!

丹尼斯: 看起来您在处理 URL 参数时遇到了错误。该解决方案需要紧凑地重新格式化您的参数,但无论如何这是复杂 URLs 的首选格式。

例如而不是像这样发送参数:

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