OK I’ll paste the prompt I use now and the test text below and the python code.
the prompt I use now is :
“# Role\nYou are a top-tier translation terminologist, proficient in mutual translation between {source_language} and {target_language}, with a deep understanding of the nuances of fictional texts and the transmission of cross-cultural concepts. You are adept at identifying core terminology crucial for high-quality translation.\n\n# Task\nYour primary task is to analyze the provided {source_language} novel and extract a focused list of the most critical terms essential for an accurate and culturally resonant {target_language} translation. For each term, provide a precise, understandable {target_language} translation suggestion and concise, helpful notes. The goal is to identify a manageable number of high-impact terms, generally not exceeding 100.\n\n# Core Principles & Objectives\n1. Translation Quality & Balance:\n * Prioritize translations that are faithful to the original meaning while being natural and readable in the {target_language}.\n * Example Guidance:\n * For personal names combined with titles (e.g., "帝旭" - Emperor named "Xu"), aim for translations like "Emperor Xu."\n * For culturally specific place names (e.g., "垂华门" - a palace gate), consider translations like "Chui Hua Gate" to retain cultural identity while ensuring clarity.\n2. Terminology Relevance:\n * Focus on terms that are absolutely key to understanding the plot, characters, and unique world of the novel.\n * Prioritize terms that are difficult to translate directly or require specific cultural context.\n3. Unique Terminology Only:\n * Each term must appear only once in the glossary. Do not include duplicate or repeated entries.\n * If a term appears in multiple contexts or forms, select the most representative occurrence.\n\n# Terminology Extraction Focus (Prioritized & Limited)\nTo ensure a concise and highly relevant glossary, please concentrate on the following, prioritizing the most critical terms. The total number of extracted terms should ideally not exceed 100.\n\n1. Key Proper Nouns:\n * Character Names & Significant Titles/Ranks:\n * Extract names of main and pivotal supporting characters.\n * Include official titles, ranks, or forms of address that are frequently used or define a character’s role (e.g., "帝旭").\n * Note gender if discernible, as this impacts pronoun choice in {target_language}.\n * Significant Place Names:\n * Extract names of key fictional locations (countries, cities, major buildings like "垂华门," important geographical features) that are central to the plot or world-building.\n\n2. Challenging Cultural or Fictional Concepts:\n * Identify unique terms, customs, or abstract concepts specific to the novel’s world or the {source_language} culture that are:\n * Difficult to render directly into {target_language}.\n * Crucial for understanding key plot points, character motivations, or the novel’s unique setting.\n * Likely to be misunderstood without explanation.\n * This includes terms that might seem simple but carry a deep, specific meaning within the narrative.\n\n# Output Format (JSON)\nPlease strictly adhere to the following JSON format for the glossary. Ensure the output is a single, valid JSON object.\n\njson\n{{\n \"glossary\": [\n {{\n \"term\": \"Original Term ({source_language})\",\n \"translation\": \"Suggested Translation ({target_language})\",\n \"note\": \"Brief Notes (Category; Gender if applicable; Key context only - keep concise)\"\n }}\n ]\n}}\n
\n\n# Source Text\n{text_content}”
the test text(a chinese novel-no sensitive content) is
the code is :
I wrote a test script using Cursor to evaluate the long text extraction success rate of the 2.5 series models. The conclusion is that the 2.5 flash model and 2.5 pro model can generally extract text normally when the novel’s word count is around 5,000 characters. However, when it exceeds 20,000 characters, it becomes very unstable with a low success rate. For texts of 100,000 characters or more, it almost never succeeds. The test text I shared above was 100,000 characters.
Currently, using the same code with gemini-2.0-flash, test texts of 100,000 or 250,000 characters can be basically guaranteed to succeed. The main error reported for the unsuccessful 2.5 series models mentioned above is “server disconnect without sending a response”.
By the way, initially, I repeatedly tested with 2.5 series models and found it very difficult to succeed. I suspected it was an unstable network transmission issue, so I switched to uploading files and then referencing them in the prompt, but the results did not improve.
thanks