Skip to content

Commit

Permalink
Translate documents to Chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Nov 28, 2023
1 parent 0450298 commit a156f1e
Show file tree
Hide file tree
Showing 40 changed files with 12,717 additions and 97 deletions.
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
---
name: 🐛Bug report
about: Create a report to help us improve
name: 🐛发现一个bug
about: 需提交版本号、触发代码、错误日志
title: ''
labels: bug
assignees: hankcs

---

<!--
Thank you for reporting a possible bug in HanLP.
Please fill in the template below to bypass our spam filter.
以下必填,否则恕不受理。
感谢找出bug,请认真填写下表:
-->

**Describe the bug**
Expand All @@ -37,3 +35,6 @@ A clear and concise description of what you expected to happen.
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

* [ ] I've completed this form and searched the web for solutions.
<!-- ⬆️此处务必勾选,否则你的issue会被机器人自动删除! -->
<!-- ⬆️此处务必勾选,否则你的issue会被机器人自动删除! -->
<!-- ⬆️此处务必勾选,否则你的issue会被机器人自动删除! -->
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: ⁉️ Need help with HanLP?
- name: ⁉️ 提问求助请上论坛
url: https://bbs.hankcs.com/
about: Join our multilingual forum and have a free discussion.
about: 欢迎前往蝴蝶效应论坛求助
13 changes: 9 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
name: 🚀Feature request
about: Suggest an idea for this project
name: 🚀新功能请愿
about: 建议增加一个新功能
title: ''
labels: feature request
assignees: hankcs

---

<!--
Thank you for suggesting an idea to make HanLP better.
Please fill in the template below to bypass our spam filter.
提问请上论坛,不要发这里!
提问请上论坛,不要发这里!
提问请上论坛,不要发这里!
以下必填,否则直接关闭。
-->

Expand All @@ -29,3 +31,6 @@ Please fill in the template below to bypass our spam filter.
**Any other info**

* [ ] I've carefully completed this form.
<!-- 发表前先搜索,此处一定要勾选! -->
<!-- 发表前先搜索,此处一定要勾选! -->
<!-- 发表前先搜索,此处一定要勾选! -->
321 changes: 235 additions & 86 deletions README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "WfGpInivS0fG"
},
"source": [
"<h2 align=\"center\">点击下列图标在线运行HanLP</h2>\n",
"<div align=\"center\">\n",
"\t<a href=\"https://colab.research.google.com/github/hankcs/HanLP/blob/doc-zh/plugins/hanlp_demo/hanlp_demo/zh/absum_restful.ipynb\" target=\"_blank\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
"\t<a href=\"https://mybinder.org/v2/gh/hankcs/HanLP/doc-zh?filepath=plugins%2Fhanlp_demo%2Fhanlp_demo%2Fzh%2Fabsum_restful.ipynb\" target=\"_blank\"><img src=\"https://mybinder.org/badge_logo.svg\" alt=\"Open In Binder\"/></a>\n",
"</div>\n",
"\n",
"## 安装"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "IYwV-UkNNzFp"
},
"source": [
"无论是Windows、Linux还是macOS,HanLP的安装只需一句话搞定:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "1Uf_u7ddMhUt"
},
"outputs": [],
"source": [
"!pip install hanlp_restful -U"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "pp-1KqEOOJ4t"
},
"source": [
"## 创建客户端"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "4M7ka0K5OMWU",
"outputId": "d74f0749-0587-454a-d7c9-7418d45ce534"
},
"outputs": [],
"source": [
"from hanlp_restful import HanLPClient\n",
"HanLP = HanLPClient('https://www.hanlp.com/api', auth=None, language='zh') # auth不填则匿名,zh中文,mul多语种"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "BMW528wGNulM"
},
"source": [
"#### 申请秘钥\n",
"由于服务器算力有限,匿名用户每分钟限2次调用。如果你需要更多调用次数,[建议申请免费公益API秘钥auth](https://bbs.hanlp.com/t/hanlp2-1-restful-api/53)。"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "elA_UyssOut_"
},
"source": [
"## 生成式自动摘要\n",
"生成式自动摘要(Abstractive Summarization)任务的目标是为文章生成一段简短的概括性摘要。 生成的摘要有可能出现原文中不存在的新短语或新句子,并且整体流畅性较高。\n",
"### 中文\n",
"生成式自动摘要任务的输入为一段文本:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "BqEmDMGGOtk3",
"outputId": "936d439a-e1ff-4308-d2aa-775955558594"
},
"outputs": [
{
"data": {
"text/plain": [
"'长江证券:看好大金属品种中的铜铝钢'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"HanLP.abstractive_summarization('''\n",
"每经AI快讯,2月4日,长江证券研究所金属行业首席分析师王鹤涛表示,2023年海外经济衰退,美债现处于历史高位,\n",
"黄金的趋势是值得关注的;在国内需求修复的过程中,看好大金属品种中的铜铝钢。\n",
"此外,在细分的小品种里,建议关注两条主线,一是新能源,比如锂、钴、镍、稀土,二是专精特新主线。(央视财经)\n",
"''')"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "jj1Jk-2sPHYx"
},
"source": [
"返回值为一段摘要。"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 英文\n",
"按照HanLP一贯的多语种设计,任何语言都支持。由于服务器GPU资源限制,目前英文接口暂未上线。如果你有相应需求,欢迎前往论坛发起请愿。"
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"collapsed_sections": [],
"name": "absum_restful.ipynb",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Loading

0 comments on commit a156f1e

Please sign in to comment.