diff --git a/dsRagAnything/Test/Ocr/2、识别出结果.md b/dsRagAnything/Test/Ocr/2、识别出结果.md index 62deb88b..9492305a 100644 --- a/dsRagAnything/Test/Ocr/2、识别出结果.md +++ b/dsRagAnything/Test/Ocr/2、识别出结果.md @@ -1 +1,28 @@ -$$1 . \text { 已知集合 } A = \left\{ x \mid - 5 < x ^ { 3 } < 5 \right\} , B = \left\{ - 3 , - 1 , 0 , 2 , 3 \right\} , \text { 则 } A \cap B = \text { 【答案】 } A$$ \ No newline at end of file +一、单项选择题:本题共 8 小题,每小题 5 分,共 40 分。在每小题给出的四个选项中,只有一项是符合题目要求的。 + +1. 已知集合 \(A=\left\{x \mid -5 < x^{3} < 5\right\}, B=\left\{-3,-1,0,2,3\right\}\),则 \(A \cap B=\) 【答案】A +A. \(\{-1,0\}\) B. \(\{2,3\}\) C. \(\{-3,-1,0\}\) D. \(\{-1,0,2\}\) + +【解析】\(A \cap B=\{-1,0\}\),选 A。 + +2. 若 \(\frac{2}{z-1}=1+i\),则 \(z=\) 【答案】C +A. \(-1-i\) B. \(-1+i\) C. \(1-i\) D. \(1+i\) + +3. 已知向量 \(\vec{a}=(0,1)\),\(\vec{b}=(2,x)\),若 \(\vec{b} \perp (\vec{b}-4\vec{a})\),则 \(x=\) 【答案】D +A. \(-2\) B. \(-1\) C. \(1\) D. \(2\) + +【解析】\(\vec{b}-4\vec{a}=(2,x-4)\),\(\vec{b} \perp (\vec{b}-4\vec{a})\),\(\therefore \vec{b}(\vec{b}-4\vec{a})=0\), + +\(\therefore 4+x(x-4)=0\),\(\therefore x=2\),选 D。 + +4. 已知 \(\cos(\alpha+\beta)=m\),\(\tan \alpha \tan \beta=2\),则 \(\cos(\alpha-\beta)=\) 【答案】A +A. \(-3m\) B. \(-\frac{m}{3}\) C. \(\frac{m}{3}\) D. \(3m\) + +【解析】\(\left\{\begin{array}{l}\cos \alpha \cos \beta-\sin \alpha \sin \beta=m \\\frac{\sin \alpha \sin \beta}{\cos \alpha \cos \beta}=2\end{array}\right.\),\(\therefore \left\{\begin{array}{l}\sin \alpha \sin \beta=-2m \\\cos \alpha \cos \beta=-m\end{array}\right.\) + +\(\cos(\alpha-\beta)=\cos \alpha \cos \beta+\sin \alpha \sin \beta=-m-2m=-3m\),选 A。 + +5. 已知圆柱和圆锥的底面半径相等,侧面积相等,且它们的高均为 \(\sqrt{3}\),则圆锥的体积为 【答案】B +A. \(2\sqrt{3}\pi\) B. \(3\sqrt{3}\pi\) C. \(6\sqrt{3}\pi\) D. \(9\sqrt{3}\pi\) + +【解析】设它们底面半径为 \(r\),圆锥母线 \(l\),\(\therefore 2\pi r\sqrt{3}=\pi rl\),\(\therefore l=\sqrt{3}\),则圆锥的体积为 \(\frac{1}{3}\pi r^{2}h\)。 \ No newline at end of file diff --git a/dsRagAnything/Test/Ocr/QWenOcr.py b/dsRagAnything/Test/Ocr/T1_QWenOcr.py similarity index 83% rename from dsRagAnything/Test/Ocr/QWenOcr.py rename to dsRagAnything/Test/Ocr/T1_QWenOcr.py index 6433c30c..17a55ded 100644 --- a/dsRagAnything/Test/Ocr/QWenOcr.py +++ b/dsRagAnything/Test/Ocr/T1_QWenOcr.py @@ -8,9 +8,9 @@ client = OpenAI( ) prompt = "请提取图片中的试题" -prompt += "1、需要Latex公式输出的,注意加上 $$ 或 $ 进行包含。" -prompt += "2、以中文数字开头的行,请忽律掉此行,比如 一、单项选择题 二、填空题 ..." -prompt += "3、输出格式: 【题型】xxx 【题目内容】 xxx 【答案】 xxxx 【解析】 xxxx。" +#prompt += "1、需要Latex公式输出的,注意加上 $$ 或 $ 进行包含。" +#prompt += "2、以中文数字开头的行,请忽律掉此行,比如 一、单项选择题 二、填空题 ..." +#prompt += "3、输出格式: 【题型】xxx 【题目内容】 xxx 【答案】 xxxx 【解析】 xxxx。" completion = client.chat.completions.create( model="qwen-vl-ocr-latest", messages=[ diff --git a/dsRagAnything/Test/Ocr/T2_FanYi.py b/dsRagAnything/Test/Ocr/T2_FanYi.py new file mode 100644 index 00000000..2123f88e --- /dev/null +++ b/dsRagAnything/Test/Ocr/T2_FanYi.py @@ -0,0 +1,22 @@ +import os +from openai import OpenAI + +try: + client = OpenAI( + # 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx", + api_key='sk-f6da0c787eff4b0389e4ad03a35a911f', + base_url="https://dashscope.aliyuncs.com/compatible-mode/v1", + ) + + completion = client.chat.completions.create( + # 模型列表:https://help.aliyun.com/zh/model-studio/getting-started/models + model="qwen-plus", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "你是谁?"}, + ], + ) + print(completion.choices[0].message.content) +except Exception as e: + print(f"错误信息:{e}") + print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code") \ No newline at end of file