- Added comprehensive AI Assistant system (aiassist/ directory): * Vector search and embedding capabilities * Typebot proxy integration * Elastic search functionality * Message classification and chat history * MCP proxy for external integrations - Implemented Court Status API (GetCourtStatus.php): * Real-time court document status checking * Integration with external court systems * Comprehensive error handling and logging - Enhanced S3 integration: * Improved file backup system with metadata * Batch processing capabilities * Enhanced error logging and recovery * Copy operations with URL fixing - Added Telegram contact creation API - Improved error logging across all modules - Enhanced callback system for AI responses - Extensive backup file storage with timestamps - Updated documentation and README files - File storage improvements: * Thousands of backup files with proper metadata * Fix operations for broken file references * Project-specific backup and recovery systems * Comprehensive file integrity checking Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
||
import sys
|
||
import json
|
||
from natasha import NamesExtractor, MorphVocab, Doc
|
||
|
||
morph_vocab = MorphVocab()
|
||
|
||
def extract_entities(text):
|
||
doc = Doc(text)
|
||
names_extractor = NamesExtractor(morph_vocab)
|
||
matches = list(names_extractor(text))
|
||
|
||
if len(matches) >= 1:
|
||
истец = matches[0].fact.first if matches[0].fact.first else 'Не определено'
|
||
else:
|
||
истец = 'Не определено'
|
||
|
||
if len(matches) >= 2:
|
||
ответчик = matches[1].fact.first if matches[1].fact.first else 'Не определено'
|
||
else:
|
||
ответчик = 'Не определено'
|
||
|
||
суть_спора = text[:100] if text else 'Не определено'
|
||
|
||
return {
|
||
"истец": истец,
|
||
"ответчик": ответчик,
|
||
"суть_спора": суть_спора
|
||
}
|
||
|
||
if __name__ == '__main__':
|
||
if len(sys.argv) < 2:
|
||
print(json.dumps({
|
||
"истец": "Не определено",
|
||
"ответчик": "Не определено",
|
||
"суть_спора": "Не определено"
|
||
}, ensure_ascii=False))
|
||
sys.exit(0)
|
||
|
||
input_text = " ".join(sys.argv[1:])
|
||
entities = extract_entities(input_text)
|
||
print(json.dumps(entities, ensure_ascii=False))
|