Commit graph

97 commits

Author SHA1 Message Date
yangdx
f69c5dfd9a Add language control and format clarity to extraction prompts 2025-09-14 18:26:41 +08:00
yangdx
6e37460964 Improve entity extraction prompt clarity and make sure LLM output content only 2025-09-14 17:50:56 +08:00
yangdx
4de1473875 Improve entity extraction prompts and error message formatting
• Fix typo in error log message
• Clarify format requirements in prompts
• Make extraction instructions clearer
• Improve user prompt consistency
2025-09-14 13:45:59 +08:00
yangdx
fd48afdb00 Use "relation" instead of "relationship" in extration prompt, and support both format for safty 2025-09-14 11:43:35 +08:00
yangdx
d993464a92 Restructure entity extraction prompt with clearer formatting and examples
* Improved instruction clarity
* Added better formatting structure
* Enhanced delimiter usage rules
* Clarified relationship handling
* Better third-person guidelines
2025-09-14 02:30:32 +08:00
yangdx
2686fc526e Change entity type from CreativeWork to Content and update delimiter
• Replace CreativeWork with Content type
• Improve LLM output error messages
• Update prompt for binary relationships
• Fix delimiter corruption examples
2025-09-14 00:55:15 +08:00
yangdx
4a5ab5121d Change delimiter from <|S|> to <|#|> and clarify formatting rules 2025-09-13 22:58:56 +08:00
yangdx
bf423a4ce1 Clarify output structure in prompt instructions by adding field count specifications 2025-09-13 09:51:33 +08:00
yangdx
369f799b16 Refine entity extraction prompts for clarity and consistency
• Clarify tuple delimiter usage
• Soften proper noun translation rules
• Standardize language requirements
• Improve output format consistency
2025-09-13 08:14:46 +08:00
yangdx
0221213b9b Improve entity summarization with JSONL format and fix tuple delimiters
• Convert descriptions to JSONL format
• Add token-based truncation helper
• Enhance entity name consistency rules
• Improve summarization prompt clarity
• Fix tuple delimiter corruption patterns
2025-09-12 12:32:08 +08:00
yangdx
1892ed23cc Change tuple delimiter from <|SEP|> to <|S|> across codebase
• Update prompt instruction clarity
• Correct utility function examples
• Update regex pattern comments
2025-09-12 08:57:46 +08:00
yangdx
b96f1484ec Shorten tuple delimiter to <|S|> and refine relationship extraction text
• Remove redundant "within input text"
• Clarify relationship extraction scope
2025-09-12 08:36:43 +08:00
yangdx
40688def20 Refactor tuple delimiter corruption fix into reusable utility function
- Extract regex fixes to utils module
- Add case-insensitive delimiter handling
2025-09-12 04:10:14 +08:00
yangdx
7f83a58497 Refactor extraction delimiters from ## to newlines and change tuple delimiter to <|SEP|>
• Add robust delimiter fixing logic
• Update prompts for single-line format
2025-09-11 13:44:44 +08:00
yangdx
02e7462645 feat: enhance LLM output format tolerance for bracket processing
- Expand bracket tolerance to support additional characters: < > " '
- Implement symmetric handling for both leading and trailing characters
- Replace simple string matching with robust regex-based pattern detection
- Maintain full backward compatibility with existing bracket formats
2025-09-10 18:10:06 +08:00
yangdx
50fddeebbf fix: Remove conversation history from prompt template
- Delete history section from prompt
- Simplify user query response format
- Remove {history} placeholder variable
2025-09-10 12:07:34 +08:00
yangdx
2dd143c935 Refactor conversation history handling to use LLM native message format
• Remove get_conversation_turns utility
• Pass history_messages to LLM directly
• Clean up prompt template formatting
2025-09-10 11:56:58 +08:00
yangdx
06db511f3b Remove angle brackets from entity and relationship output formats 2025-09-09 09:21:23 +08:00
yangdx
d218f15a62 Refactor entity extraction with system prompts and output limits
- Add system/user prompt separation
- Set max tokens for endless output fix
- Improve extraction error logging
- Update cache type from extract to summary
2025-09-08 15:20:45 +08:00
yangdx
725db3b240 Fix linting in the prompt 2025-09-06 11:16:49 +08:00
yangdx
219a08b7c9 Restore completion_delimiter 2025-09-06 11:13:37 +08:00
yangdx
528d04a0e4 Update prompt template delimiters 2025-09-06 10:35:06 +08:00
yangdx
5446815008 Refactor entity extraction prompts and remove completion delimiter.
- Remove `completion_delimiter` from prompts
- Update input/output format markers
2025-09-06 09:13:51 +08:00
yangdx
be3f0ebbe5 Simplify entity extraction prompt instructions and remove delimiter 2025-09-04 23:42:11 +08:00
yangdx
3f56c6820c Reorder language and completion delimiter instructions in prompt 2025-09-04 23:05:16 +08:00
yangdx
50adf64fab Fix linting in prompt 2025-09-04 15:22:36 +08:00
yangdx
94114df995 Improve prompt clarity and structure 2025-09-04 14:53:27 +08:00
yangdx
7b35657e32 Refactor entity extraction prompt formatting and clarity
- Remove quotes from tuple format strings
- Simplify relationship extraction text
- Add relationships to quality guidelines
2025-09-04 10:47:57 +08:00
yangdx
78abb397bf Reorder entity types and add Document type to extraction 2025-09-03 12:44:40 +08:00
yangdx
95c08cc7dc Improve entity extraction prompt clarity by replacing pronouns with specific nouns 2025-09-03 12:35:52 +08:00
yangdx
c86f863fa4 feat: optimize entity extraction for smaller LLMs
Simplify entity relationship extraction process to improve compatibility
and performance with smaller, less capable language models.

Changes:
- Remove iterative gleaning loop with LLM-based continuation decisions
- Simplify to single gleaning pass when entity_extract_max_gleaning > 0
- Streamline entity extraction prompts with clearer instructions
- Add explicit completion delimiter signals in all examples
2025-09-03 10:33:01 +08:00
yangdx
29f0ecc88c Refactor entity extraction prompts and remove completion delimiter
• Update prompt structure and wording
• Remove deprecated completion delimiter
• Add quality guidelines section
• Improve instruction clarity
• Enhance continue extraction prompt
2025-09-02 02:14:14 +08:00
yangdx
692357fbf3 Add conflict resolution instruction to entity summarization prompt
- Add conflict handling step
- Handle entities with same name
- Separate then consolidate summaries
2025-09-01 08:51:19 +08:00
yangdx
ec059d1b5d Fix typo and clarify delimiter formatting in relationship extraction Prompt
- Fix "feild" → "field" typo
- Clarify delimiter spacing rules
2025-09-01 00:42:59 +08:00
yangdx
4e751e0653 refac: Enhance extraction with improved prompts and parser
-   **Prompts**: Restructured prompts with clearer steps and quality guidelines. Simplified the relationship tuple by removing `relationship_strength`
-   **Model**: Updated default entity types to be more comprehensive and consistently capitalized (e.g., `Location`, `Product`)
2025-08-31 22:24:11 +08:00
yangdx
ff0a18e08c Unify SUMMARY_LANGUANGE and ENTITY_TYPES implementation method 2025-08-27 12:23:22 +08:00
Thibo Rosemplatt
c3aabfc251 Merge branch 'main' into entityTypesServerSupport 2025-08-26 21:48:20 +02:00
yangdx
e0a755e42c Refactor prompt instructions to emphasize depth and completeness 2025-08-26 18:28:57 +08:00
yangdx
01a2c79f29 Standardize prompt formatting and section headers across templates
- Remove hash delimiters
- Consistent section headers
- Add "Output:" labels
- Clean up example formatting
2025-08-26 14:42:52 +08:00
yangdx
6bcfe696ee feat: add output length recommendation and description type to LLM summary
- Add SUMMARY_LENGTH_RECOMMENDED parameter (600 tokens)
- Optimize prompt temple for LLM summary
2025-08-26 14:41:12 +08:00
Thibo Rosemplatt
d054ec5d00 Added entity_types as a user defined variable (via .env) 2025-08-23 20:16:11 +02:00
yangdx
950221db59 Refactor keyword extraction rules and remove overlap constraint
• Require content in both keyword categories
• Remove no-overlap rule between lists
• Simplify edge case handling
• Clarify source of truth requirement
2025-08-19 15:12:15 +08:00
yangdx
92c0ad0076 Fix linting 2025-08-19 00:45:29 +08:00
yangdx
23334e7e51 Update prompt.py 2025-08-19 00:29:33 +08:00
yangdx
2a7fec2873 Optimize keyword extraction prompt, and remove conversation history from keywork extraction.
- Remove history context processing
- Update prompt to focus on single query
- Clarify high/low level keyword types
- Improve JSON output instructions
- Add edge case handling guidance
2025-08-18 23:35:04 +08:00
yangdx
8d7a7e4ad6 Refactor prompt templates with improved guidelines and citation formats 2025-08-18 19:14:32 +08:00
yangdx
9c4e98ec3b Unify entity extraction prompt between passes
- Disallow hallucinated info in descriptions
- Align reminder steps with main extraction
2025-07-27 23:06:55 +08:00
Daniel.y
4eef9f3778
Merge pull request #1845 from AkosLukacs/patch-2
Better prompt for entity description extraction to avoid hallucinations
2025-07-27 22:38:08 +08:00
yangdx
f2d051eea5 Fix: Improve keyword extraction prompt for robust JSON output.
*   Emphasize strict JSON output in key extration prompt
*   Clean up prompt examples in key extration prompt
*   Log raw LLM response on JSON error
2025-07-27 21:10:47 +08:00
yangdx
cf1ca39b3f Refine entity continuation prompt to avoid duplicates.
- Clarify finding missing entities
- Instruct not to repeat extractions
2025-07-27 10:48:29 +08:00