QuantEcon / lecture-intro.zh-cn

An Undergraduate Lecture Series for the Foundations of Computational Economics (Chinese Language)
https://quantecon.github.io/lecture-intro.zh-cn/
2 stars 0 forks source link

Potential Issues in AI Translation #5

Open HumphreyYang opened 2 months ago

HumphreyYang commented 2 months ago

fontP = font_manager.FontProperties() fontP.set_family('SimHei') fontP.set_size(14)


- [x] code cells are sometimes broken into two and we need to delete the code block AI created in the middle to run the code.  (I have updated the code to take out code cells separately, but it has limitation if we have code cell with 4000+ characters)
HumphreyYang commented 1 month ago

Sometimes the model hallucinates and gives its summary of the lecture at the end.

HumphreyYang commented 1 month ago

The model cannot handle cases with

'````' in the exercise directives

HumphreyYang commented 1 month ago

Hi @mmcky,

I found some of the problems above are related to the input size. Relatively short input is sometimes better.

We can also try the Google translation suggested by @longye-tian.

Hi @longye-tian, I have a Google developer account to access APIs, and we can coordinate to experiment with Google translation if you need any help. I think we can add a function to call Google Translate API in the translation.py.

I have a document split function and paralleled document processing setup there, which might be helpful -- it parses through all the lectures and calls APIs in less than 10 minutes! Let me know if there is anything I can help!

HumphreyYang commented 1 week ago
  • [ ] matplotlib requires an update in the font library to show Chinese:
from matplotlib import font_manager

fontP = font_manager.FontProperties()
fontP.set_family('SimHei')
fontP.set_size(14)
  • [x] code cells are sometimes broken into two and we need to delete the code block AI created in the middle to run the code. (I have updated the code to take out code cells separately, but it has limitation if we have code cell with 4000+ characters)

In addition to this, on Linux machine/server, we need to add the Chinese font missing by adding the font SimHei.ttf to the mpl directory (i.e.,

/home/humphrey/anaconda3/envs/quantecon/lib/python3.1/site-packages/matplotlib/mpl-data/fonts/ttf

)

mmcky commented 3 days ago

@HumphreyYang do I need to add these fonts still?

HumphreyYang commented 3 days ago

No not anymore. We can use the new solution without modifying the infrastructure side:

https://github.com/QuantEcon/lecture-intro.zh-cn/issues/30#issuecomment-2367889578

Many thanks @mmcky : )