优化提示词
This commit is contained in:
10
README.md
10
README.md
@@ -313,3 +313,13 @@ translater = FileTranslater(base_url="<baseurl>",
|
||||
### Filetranslater的解析缓存机制
|
||||
|
||||
工具默认会缓存最近10条(全局)解析记录存于内存中,可以通过`DOCUTRANSLATE_CACHE_NUM`环境变量进行修改
|
||||
|
||||
## Star History
|
||||
|
||||
<a href="https://star-history.com/#xunbu/docutranslate&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xunbu/docutranslate&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xunbu/docutranslate&type=Date" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=xunbu/docutranslate&type=Date"/>
|
||||
</picture>
|
||||
</a>
|
||||
@@ -20,7 +20,7 @@ class MDRefineAgent(Agent):
|
||||
形如<ph-ads231>的占位符不要改变【非常重要】
|
||||
code、latex和HTML保持结构
|
||||
所有公式(包括短公式)都应该是latex公式
|
||||
修复不正确的latex公式,行内公式要用$正确包裹以构造合法latex表达式
|
||||
公式无论长短必须表示为能被解析的合法latex公式,公式需被$或\\(\\)或$$正确包裹,如不正确则进行修正
|
||||
# 输出
|
||||
修正后的markdown纯文本(不是markdown代码块)
|
||||
# 示例
|
||||
@@ -56,8 +56,7 @@ class MDTranslateAgent(Agent):
|
||||
不输出任何解释和注释
|
||||
不能改变形如<ph-xxxxxx>的占位符
|
||||
code、latex和HTML只翻译说明文字,其余保持原文
|
||||
公式无论长短必须表示为能被解析的合法latex公式,公式需被$或\\(\\)或$$正确包裹,如不正确则进行修正
|
||||
表格如果是table标签请改为普通表格写法,注意表格正确性
|
||||
所有公式无论长短必须表示为能被解析的合法latex公式,公式需被$或\\(\\)或$$正确包裹,如不正确则进行修正
|
||||
去除、修正明显异常的字符、但不能改变原意
|
||||
引用参考文献时请严格保持原文,不要翻译。参考文献格式示例如下:
|
||||
[1] Author A, Author B. "Original Title". Journal, 2023.
|
||||
|
||||
@@ -24,10 +24,4 @@ class Converter(Protocol):
|
||||
...
|
||||
|
||||
async def convert_async(self,document:Document)->str:
|
||||
...
|
||||
|
||||
def set_config(self,cofig:dict):
|
||||
...
|
||||
|
||||
def get_config_list(self)->list[str]|None:
|
||||
...
|
||||
@@ -72,12 +72,6 @@ class ConverterDocling(Converter):
|
||||
# translater_logger.info(f"docling转换耗时: {conversion_result.timings["pipeline_total"].times}")
|
||||
return result
|
||||
|
||||
def set_config(self, cofig: dict):
|
||||
pass
|
||||
|
||||
def get_config_list(self) -> list[str] | None:
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
|
||||
@@ -124,12 +124,6 @@ class ConverterMineru(Converter):
|
||||
self.logger.info(f"已转换为markdown,耗时{time.time() - time1}秒")
|
||||
return result
|
||||
|
||||
def set_config(self, cofig: dict):
|
||||
pass
|
||||
|
||||
def get_config_list(self) -> list[str] | None:
|
||||
pass
|
||||
|
||||
|
||||
def get_md_from_zip_url_with_inline_images(
|
||||
zip_url: str,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user