Skip to content

Commit 0871fb5

Browse files
committed
Update 文本翻译.md
1 parent d1857c3 commit 0871fb5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/办公自动化/自然语言处理/文本翻译.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## translators
2+
`translators` 算是一个支持语言比较多、使用门槛比较低的一个良心库了。
3+
4+
最初是为大学生做国际化使用的。
5+
6+
```shell
7+
pip install translators
8+
```
9+
10+
```python
11+
import translators as ts
12+
13+
chs_text = '于谦的父亲郭老爷子。'
14+
en_text = "Yu Qian's father, father Guo."
15+
16+
# professional field
17+
print(ts.alibaba(en_text, from_language='auto', to_language='zh', professional_field='general'))
18+
print(ts.caiyun(chs_text, from_language='zh', professional_field=None))
19+
```
20+
121
## 阿里云开放平台翻译 API
222
首先安装所需的依赖库
323
```shell

0 commit comments

Comments
 (0)