我无法连接到HateBase API。为了使调试更容易,我在这里分解了代码:
key ='blah blah'
base_url = 'https://api.hatebase.org'
url = "https://api.hatebase.org/4-4/authenticate"
payload = "api_key=" + key
response = requests.post(url, data=payload, headers=headers)
token = response.json()
print(token)产出:
{'datetime': '2022-03-02 18:32:13',
'errors': {'8752': 'The version of the API is now retired; please update your queries to resume accessing the API'},
'important': "Your use of the HateBase API acknowledges your consent with Hatebase's Terms of Use (available online at hatebase.org) and PROHIBITS REDISTRIBUTION of this data for any purpose, including but not limited to republication in any form, such as in PUBLIC CODE REPOSITORIES.",
'query': {'api_key': 'blah blah'},
'version': '4.4'}我不确定HateBase API本身是否有问题.或者,如果有人知道一个已经收集了所有HateBase词汇的来源,我会很感激。
发布于 2022-03-14 18:38:56
显然,Hatebase不再被积极维护,所以他们退出了Hatebase。我给他们发了一封电子邮件,他们建议我尝试武器化的单词。
“一个很好的替代方法是武器化词,这是一个与Hatebase非常相似的新项目:它对符合条件的学术研究人员免费,并有一个多语种词汇、一个API和一个内置的自然语言解析器。此时,武器化单词上的语言覆盖率大约是Hatebase词典的两倍。”
这对我来说也很令人沮丧,因为我最后一次使用API是在2021年,所以我不知道发生了什么。我还没有试过这个新工具,但我很高兴它们至少提供了一个替代方案:)
https://stackoverflow.com/questions/71327691
复制相似问题