|
@@ -50,23 +50,72 @@ async def run_langchain_on_inventions(data, model_name='gpt-4o-mini'):
|
|
|
# Prompt template
|
|
|
prompt_template = PromptTemplate(
|
|
|
input_variables=["invention"],
|
|
|
- template="""
|
|
|
- Break down the provided text, which may be an invention claim or description, into concise technical features using only the exact terms and language from the text. Each feature should capture essential elements without adding any interpretation, rephrasing, or extra context beyond what is explicitly stated.
|
|
|
- The text may describe either an apparatus, a physical device or structure, or a methodology, which outlines a process with a sequence of steps.
|
|
|
+ template = """
|
|
|
+ Break down the provided text, which may describe a technical solution, invention claim, or methodology, into distinct and well-defined technical features. Each feature must adhere to the following guidelines:
|
|
|
|
|
|
- For apparatus claims, identify each structural element and its technical role or configuration exactly as stated in the text. For methodology claims, list each step in the exact sequence provided, preserving only the dependencies and terms given.
|
|
|
+ 1. **Technical Precision**:
|
|
|
+ - Capture the structural, functional, or process-related elements described in the text.
|
|
|
+ - Each feature should focus on one unique aspect or functionality of the described solution.
|
|
|
|
|
|
- Each feature should be a single, concise sentence that strictly uses only the provided terms. Number features sequentially (F1, F2, etc.) and follow the exact output structure below.
|
|
|
+ 2. **Completeness**:
|
|
|
+ - Write each feature as a complete, standalone sentence that specifies the component, configuration, or function clearly.
|
|
|
+ - Avoid vague language or incomplete descriptions. Each feature must include enough context to be meaningful on its own.
|
|
|
|
|
|
- Invention: {invention}
|
|
|
+ 3. **Clarity and Consistency**:
|
|
|
+ - Exclude phrases like "the present invention" or narrative elements that do not contribute directly to the technical details.
|
|
|
+ - Focus on unique features and avoid unnecessary repetition.
|
|
|
|
|
|
- Output:
|
|
|
+ 4. **Fallback Instructions**:
|
|
|
+ - If the provided text is abstract or lacks distinct technical elements, break it down into general purposes, key objectives, and any identifiable components or methodologies. Each feature should focus on specific technical attributes or intended functions.
|
|
|
+ - If the text does not explicitly list components or steps, infer features based on the described purpose or functionality, ensuring each feature is precise and self-contained.
|
|
|
+
|
|
|
+
|
|
|
+ ### Example Inputs and Outputs:
|
|
|
+
|
|
|
+ #### Example 1:
|
|
|
+ **Input**:
|
|
|
+ The solution proposes a hanger bracket (Fishtail/Y-support bracket) for an exhaust system that includes a fin design to give structural rigidity and allows support for a hanger rod. A fin/plate is attached to the rod and then it will engage a slot in the bracket for tolerance control. The hanger bracket (Fishtail/Y-support bracket) is supported on a square tube or on a triangular tube with adjustment slots, which allows adjustment fore/aft, and up/down for tolerance stacks. The hanger bracket can be provided with a chamfer.
|
|
|
+
|
|
|
+ **Output**:
|
|
|
+ {{
|
|
|
+ "F1": "A hanger bracket (Fishtail/Y-support bracket) includes a fin design to give structural rigidity and allows support for a hanger rod.",
|
|
|
+ "F2": "A fin/plate is attached to the rod, then it will engage a slot in the bracket for tolerance control.",
|
|
|
+ "F3": "The hanger bracket (Fishtail/Y-support bracket) supports on a square tube or on a triangular tube with adjustment slots, which allows adjustment fore/aft, and up/down for tolerance stacks.",
|
|
|
+ "F4": "The hanger bracket includes a chamfer."
|
|
|
+ }}
|
|
|
+
|
|
|
+ #### Example 2:
|
|
|
+ **Input**:
|
|
|
+ A toilet seat and a cover member disposed behind the toilet seat to cover a rear part of a toilet bowl, the cover member comprising: a first standing part formed on the toilet seat side; an inclined part connected to a rear end of the first standing part and extending upward and downward; A second rising portion connected to a rear end of the inclined portion; and an extending portion connected to a rear end of the second rising portion and extending rearward, wherein the inclined portion is formed to be inclined at a steeper inclination than the extending portion.
|
|
|
+
|
|
|
+ **Output**:
|
|
|
{{
|
|
|
- "F1": "Feature description using only exact terms...",
|
|
|
- "F2": "Next concise feature with only explicit details..."
|
|
|
+ "F1": "A toilet seat and a cover member disposed behind the toilet seat to cover a rear part of a toilet bowl.",
|
|
|
+ "F2": "The cover member comprising a first standing part formed on the toilet seat side.",
|
|
|
+ "F3": "An inclined part connected to a rear end of the first standing part and extending upward and downward.",
|
|
|
+ "F4": "A second rising portion connected to a rear end of the inclined portion.",
|
|
|
+ "F5": "An extending portion connected to a rear end of the second rising portion and extending rearward.",
|
|
|
+ "F6": "The inclined portion is formed to be inclined at a steeper inclination than the extending portion."
|
|
|
}}
|
|
|
|
|
|
- """
|
|
|
+ ### Analysis Process:
|
|
|
+ 1. Identify distinct components, configurations, or processes described in the text.
|
|
|
+ 2. For each unique aspect, create a feature that captures the key technical detail, ensuring it is specific and complete.
|
|
|
+ 3. Where variations or optional features are described, include them as separate features (e.g., a chamfer being present or absent).
|
|
|
+ 4. If no clear features can be extracted, revert to the fallback approach by breaking down the text line-by-line and using each line as a feature. If the provided text is abstract or lacks distinct technical elements, break it down into general purposes, key objectives, and any identifiable components or methodologies.
|
|
|
+
|
|
|
+ Input Text: {invention}
|
|
|
+
|
|
|
+ Strictly follow the JSON Output Structure below, No extra content
|
|
|
+
|
|
|
+
|
|
|
+ Output:
|
|
|
+ {{
|
|
|
+ "F1": "First technical feature...",
|
|
|
+ "F2": "Second technical feature...",
|
|
|
+ ...
|
|
|
+ }}
|
|
|
+ """
|
|
|
|
|
|
|
|
|
)
|