有没有AI应用大佬,请教一个英文单词生成句子的方案?

背单词啊背单词,还是例句靠谱些,准备自己用 AI 生成考虑单词例句,希望一个句子包含尽可能多的单词, 比如一个句子可以包含10个考研单词,目前有两个问题

  1. 我的 prompt 似乎没办法让 AI 生成完整的清单,不确定是不是 AI 模型不支持这么大的,丢 4000 单词进去似乎不行,200 个似乎也不行.
  2. 有没有推荐的模型干这个活? 感谢

我的 prompt, 效果不错

# 角色
你是一名中英文双语教育专家,具备深厚的语言学知识和教学经验。具有 4 万多的词汇量,并有惊人的阅读量,可以轻松根据英文单词创建合适的例句,拥有帮助将中文视为母语的用户理解和记忆英语单词的专长,请根据用户提供的英语单词完成下列任务。
# 任务
## 例句生成:
- 根据用户提供英语单词生成英文例句。
- 有能力生成上百句英文例句,将用户提供的单词全部包含在这些例句中。
- 例句包含的单词不要超过 39 个。
- 每个例句中至少包含 5 个用户提供的单词,可以是单词的其他形态。
- 每个例句中尽量多的使用用户提供的单词,以减少例句的数量。
- 确保例句的语法正确,自然流畅,尽可能使用简单语法。
- 如果用户提供的英文单词中有多个常用释义,可以将此单词用于多个例句中以表达其不同的含义。
- 使用 markdown 语法将需要学习的英文单词高亮。
- 请检查例句 3 次,确认没有语法错误。
- 生成的例句中必须包含用户提供的所有单词,如果没有全部包含,请继续按照要求生成例句。

## 例句翻译:
- 对于每个例句,提供对应的中文释义。

## 单词解释:
- 提供单词在例句中的简明释义。
- 提供单词的音标,音标需要使用 DJ 音标,以下是所有音标:iː ɪ e æ ɑː ɒ ɔː ʊ uː ʌ ɜːr ər eɪ aɪ oʊ aʊ ɔɪ p b t d k ɡ tʃ dʒ f v θ ð s z ʃ ʒ h m n ŋ l r j w ,如果你返回的音标不在其中,那一定是版本没用对,请检查是否符合版本要求。

## 输出格式如下:
**例句:**She **lacked** the **necessary** resources to **complete** the project, leading to a **failure** **despite** her **efforts**.
**翻译:**她缺乏完成项目所需的资源,尽管努力仍导致失败。
**单词:**
**lack**/læk/ - v. 缺乏,缺少
**necessary**/ˈnesəsərɪ/ - adj. 必要的,必需的
**complete**/kəmˈpliːt/ - v. 完成
**failure**/ˈfeɪljər/ - n.失败
**despite**/dɪˈspaɪt/ - prep. 尽管
**effort**/ˈefərt/ - n. 努力

可以换个思路,找一本电子词典(比如《牛津高阶英汉双解词典》),再写个程序(让 AI 来搞应该就好),从词典文件中提取例句。

做了爬虫直接查有道词典。

忘了说了, 希望一个句子包含尽可能多的单词, 比如一个句子可以包含10个考研单词

关于模型:我不专业,没有更多建议
针对问题:嗯…如果您的prompt有能力提供一定数量(如30个词)的单词表,并且AI都能理解,那就没问题。没有必要一次性上4000词的单词表。参考一下IDM,从所有考研单词里面随机抽30个,扔给AI。抽若干次,直到单词表被均匀地覆盖为止

可以的,AI写的代码,可以使用

import os
import requests
import time
import warnings
from requests.packages.urllib3.exceptions import InsecureRequestWarning

# 禁用不安全请求的警告
warnings.simplefilter('ignore', InsecureRequestWarning)

# API配置
API_URL = "https://api.oaibest.com/v1/chat/completions"
API_KEY = "key"

def main():
    # 读取prompt
    try:
        with open("prompt.txt", "r", encoding="utf-8") as f:
            prompt = f.read().strip()
    except FileNotFoundError:
        print("Error: prompt.txt not found!")
        return
    
    # 获取所有input文件并按名称排序
    input_files = sorted([f for f in os.listdir() 
                         if f.startswith("input") and f.endswith(".txt")])
    
    if not input_files:
        print("No input files found!")
        return
    
    # 处理每个input文件
    for input_file in input_files:
        print(f"Processing {input_file}...")
        
        # 读取input文件内容
        try:
            with open(input_file, "r", encoding="utf-8") as f:
                input_text = f.read().strip()
        except Exception as e:
            print(f"Error reading {input_file}: {e}")
            continue
        
        # 将prompt和input_text合并到一个消息中
        combined_message = f"{prompt}\n\n{input_text}"
        
        # 准备请求数据
        data = {
            "model": "o1-mini",
            "messages": [
                {"role": "user", "content": combined_message}
            ]
        }
        
        headers = {
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json"
        }
        
        try:
            # 发送请求,禁用SSL验证
            response = requests.post(API_URL, json=data, headers=headers, verify=False)
            
            if response.status_code == 200:
                # 解析响应
                result = response.json()["choices"][0]["message"]["content"]
                
                # 将结果追加到output.txt
                with open("output.txt", "a", encoding="utf-8") as f:
                    f.write(f"\n=== Response for {input_file} ===\n")
                    f.write(result)
                    f.write("\n")
                
                print(f"Successfully processed {input_file}")
            else:
                print(f"Error processing {input_file}: {response.status_code} - {response.text}")
        
        except requests.exceptions.RequestException as e:
            print(f"Request error for {input_file}: {e}")
        except Exception as e:
            print(f"Unexpected error processing {input_file}: {e}")
        
        # 在处理下一个文件前等待1秒
        time.sleep(1)
    
    print("\nAll files processed. Results saved in output.txt")

if __name__ == "__main__":
    main()

最好你还是准备一个考研单词的文件,把文件给ai,让它从这里面限定抽取。现在大部分国产ai都支持资料库,或者用notebookllm。
而且你那个Prompt例句条件写的太多了,ai容易抽风,要么你换成新出的推理型,要么就把任务拆分。
我记得智谱api有个GLM-4-long的模型,支持1mtoken,你这个估计需要超长token,或gemini2最近好像升级到了10万token

试下 google ai studio