Spaces:
Running
Running
Merge branch 'master' of https://github.com/binary-husky/chatgpt_academic into master
Browse files- README.md +1 -0
- multi_language.py +13 -2
README.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
| 10 |
**如果喜欢这个项目,请给它一个Star;如果你发明了更好用的快捷键或函数插件,欢迎发pull requests**
|
| 11 |
|
| 12 |
If you like this project, please give it a Star. If you've come up with more useful academic shortcuts or functional plugins, feel free to open an issue or pull request. We also have a README in [English|](docs/README_EN.md)[日本語|](docs/README_JP.md)[한국어|](https://github.com/mldljyh/ko_gpt_academic)[Русский|](docs/README_RS.md)[Français](docs/README_FR.md) translated by this project itself.
|
|
|
|
| 13 |
|
| 14 |
> **Note**
|
| 15 |
>
|
|
|
|
| 10 |
**如果喜欢这个项目,请给它一个Star;如果你发明了更好用的快捷键或函数插件,欢迎发pull requests**
|
| 11 |
|
| 12 |
If you like this project, please give it a Star. If you've come up with more useful academic shortcuts or functional plugins, feel free to open an issue or pull request. We also have a README in [English|](docs/README_EN.md)[日本語|](docs/README_JP.md)[한국어|](https://github.com/mldljyh/ko_gpt_academic)[Русский|](docs/README_RS.md)[Français](docs/README_FR.md) translated by this project itself.
|
| 13 |
+
To translate this project to arbitary language with GPT, read and run [`multi_language.py`](multi_language.py) (experimental).
|
| 14 |
|
| 15 |
> **Note**
|
| 16 |
>
|
multi_language.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
"""
|
| 2 |
-
Translate this project to other languages
|
|
|
|
|
|
|
| 3 |
Usage:
|
| 4 |
1. modify LANG
|
| 5 |
LANG = "English"
|
|
@@ -11,7 +13,16 @@
|
|
| 11 |
Note: You need to run it multiple times to increase translation coverage because GPT makes mistakes sometimes.
|
| 12 |
|
| 13 |
4. Find the translated program in `multi-language\English\*`
|
|
|
|
|
|
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
"""
|
| 16 |
|
| 17 |
import os
|
|
@@ -217,7 +228,7 @@ def trans(word_to_translate, language, special=False):
|
|
| 217 |
# for a,b in zip(res_before_trans, res_after_trans):
|
| 218 |
# translated_result[a] = b
|
| 219 |
# except:
|
| 220 |
-
print('GPT
|
| 221 |
res_before_trans = eval(result[i-1])
|
| 222 |
for a in res_before_trans:
|
| 223 |
translated_result[a] = None
|
|
|
|
| 1 |
"""
|
| 2 |
+
Translate this project to other languages (experimental, please open an issue if there is any bug)
|
| 3 |
+
|
| 4 |
+
|
| 5 |
Usage:
|
| 6 |
1. modify LANG
|
| 7 |
LANG = "English"
|
|
|
|
| 13 |
Note: You need to run it multiple times to increase translation coverage because GPT makes mistakes sometimes.
|
| 14 |
|
| 15 |
4. Find the translated program in `multi-language\English\*`
|
| 16 |
+
|
| 17 |
+
P.S.
|
| 18 |
|
| 19 |
+
- The translation mapping will be stored in `docs/translation_xxxx.json`, you can revised mistaken translation there.
|
| 20 |
+
|
| 21 |
+
- If you would like to share your `docs/translation_xxxx.json`, (so that everyone can use the cached & revised translation mapping), please open a Pull Request
|
| 22 |
+
|
| 23 |
+
- If there is any translation error in `docs/translation_xxxx.json`, please open a Pull Request
|
| 24 |
+
|
| 25 |
+
- Welcome any Pull Request, regardless of language
|
| 26 |
"""
|
| 27 |
|
| 28 |
import os
|
|
|
|
| 228 |
# for a,b in zip(res_before_trans, res_after_trans):
|
| 229 |
# translated_result[a] = b
|
| 230 |
# except:
|
| 231 |
+
print('GPT answers with unexpected format, some words may not be translated, but you can try again later to increase translation coverage.')
|
| 232 |
res_before_trans = eval(result[i-1])
|
| 233 |
for a in res_before_trans:
|
| 234 |
translated_result[a] = None
|