Request interface and transform | Hanlp
I got some problems when I am using the client recommend in the official document, that doesn't work for my current project. Instead I used the same way that work as I expected.
import requests
import pandas as pdif __name__ == '__main__':
'''
1. login and get api and token.
2. change test contents.
'''
url = "http://comdo.hanlp.com/api"msg = "2021年HanLPv2.1为生产环境带来次世代最先进的多语种NLP技术。阿婆主来到北京立方庭参观自然语义科技公司。"headers = {
"token":"your token"
}postData = https://www.it610.com/article/{"text":"2021年HanLPv2.1为生产环境带来次世代最先进的多语种NLP技术。阿婆主来到北京立方庭参观自然语义科技公司."
}r = requests.post(url, headers=headers, data=https://www.it610.com/article/postData)
data = r.json()
# transform into dataframe
df = pd.DataFrame.from_dict(data)
Reference:
1.hanlp doc
2.use hanlp api
【Request interface and transform | Hanlp】3.convert JSON data from Request into Pandas Dataframe
推荐阅读
- android第三方框架(五)ButterKnife
- Android中的AES加密-下
- Eddy小文
- 带有Hilt的Android上的依赖注入
- android|android studio中ndk的使用
- Android事件传递源码分析
- RxJava|RxJava 在Android项目中的使用(一)
- Android7.0|Android7.0 第三方应用无法访问私有库
- 深入理解|深入理解 Android 9.0 Crash 机制(二)
- EditText默认不获取焦点弹出键盘