prompt="""You are an expert in materials science. You need analyze the composition and synthesis/process of the materials and extract the material names from the text.
Follow these rules strictly:
1. For composition and synthesis process analysis:
- Describe all materials and their contents, synthesis process, etc. you find in the text, like:
Base materials: Material1, Material2, Material3
Modifiers identified: Additive with contents of 1 mass%, 3 mass%, and 5 mass%
Additional components: Curing agent, etc.
Synthesis: The materials were synthesized by mixing the base materials and modifiers.
Process: The materials were annealed at 1000°C for 1 hour.
2. For material names:
- List all materials that were actually tested, following these rules strictly, only use to distinguish different materials:
- Include only materials with measured properties, this rule has priority over the other rules.
- Use the abbreviations of sample provided by the author if possible, such as P1, P2, P3, etc.
- If no name is provided, generate a unique name based on the composition and synthesis process. The process is not required, and only needed when different materials with different processes are tested.
- The name should be as concise as possible, and should not be too long.
- If the text is not related to materials, return empty string.
3. For material types:
- List the material type corresponding to each material listed above in material names.
- Use "linear" or "cross_linked" to indicate the structure of polymers, instead of "polymer".
- If the polymer structure ("linear" or "cross_linked") is not specified, default to "cross_linked".
- Ensure the number of material types matches the number of material names.
Do not include explanations, markdown formatting, or code fences (```).
base_prompt="""You are an expert in polymer materials.
Several polymers are mentioned in this article.
Your task is to extract the following glass transition temperature (Tg)–related information for each polymer as explicitly stated in the article only (do not use general knowledge or cited references).
If any information is not present in the article, leave the corresponding cell empty.
Field descriptions:
- name: material name.
- tg: The glass transition temperature of the polymer, including its unit (e.g. "250 °C").
- method: The method used to measure Tg (e.g. DSC, DMA).
- parameter: Experimental parameters of the Tg measurement, such as scan cycle, scan range, heating rate, frequency, etc. Do not include parameters unrelated to Tg measurements (e.g. cure process parameters).
- instrument: The model of the device used to measure Tg.
- tg_note: Supplementary information for the Tg data, such as the state of the material, synthesis process, test process, cycle number, or other remarks.
Output format:
Return the result as a raw CSV table with the header: name,tg,method,parameter,instrument,tg_note
Requirments:
- List each polymer as one separate row under the header.
- If multiple variants or versions of the same polymer are tested under different conditions, list all combinations as separate rows (e.g. Cartesian product if applicable).
- Do not output JSON, Markdown, or any extra explanatory text.
- Do not add any text before or after the CSV table.
- For each material, if there is no Tg data, do not output the material.
Example output:
name,tg,method,parameter,instrument,tg_note
Polymer A,250 °C,DSC,5 °C/min to 400 °C,TA Q200,as-cured
Polymer B,180 °C,DMA,1 Hz; 3 °C/min,TA Q800,cured 2 h at 180 °C
"""
system_prompt=base_prompt+f"\nThis rule has the highest priority: Only extract information for the following materials:\n\"meta-meta-linked BPDA-ODA PAE\", \"meta-para-linked BPDA-ODA PAE\", \"para-para-linked BPDA-ODA PAE\", \"mixed BPDA-ODA PAE\" "
system_prompt="Please rewrite the following paragraph into a concise summary that preserves the core meaning and key information:",# System prompt for math problem solving
hf_model_name_or_path="Qwen2.5-7B-Instruct",# set to your own model path
vllm_tensor_parallel_size=1,
vllm_max_tokens=8192,
)
self.prompt_generator=PromptedGenerator(
llm_serving=self.llm_serving,
system_prompt="Please rewrite the following paragraph into a concise summary that preserves the core meaning and key information:",# System prompt for math problem solving