- 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.
3.3 KiB
3.3 KiB
Парсер судебных документов
Скрипт для извлечения структурированных данных из судебных документов.
Файлы
court_document_parser.py- основной скрипт парсераcourt_parser_api.py- API endpoint для вызова из n8ntest_input.json- пример входных данных
Использование
1. Прямой вызов скрипта
# Чтение из файла
python3 court_document_parser.py --input input.json --output output.json
# Чтение из stdin, вывод в stdout
echo '{"combinedText": "..."}' | python3 court_document_parser.py --stdin --stdout
# Чтение из файла, вывод в stdout
python3 court_document_parser.py --input input.json --stdout
2. Вызов через API endpoint (для n8n)
# Чтение из stdin, вывод в stdout
echo '{"combinedText": "..."}' | python3 court_parser_api.py
3. Вызов из n8n через SSH
В n8n используйте SSH node со следующими параметрами:
- Command:
python3 /var/www/fastuser/data/www/crm.clientright.ru/crm_extensions/court_parser_api.py - Input: JSON с полем
combinedText
Формат входных данных
[
{
"combinedText": "Текст судебного документа..."
}
]
Формат выходных данных
[
{
"case_number": "М-5071/2025",
"execution_number": null,
"uid": "50RS0052-01-2025-007323-70",
"court": "Щелковский городской суд",
"plaintiff": "Соколов Александр Владимирович",
"defendant": "ООО СКИЛБОКС",
"document_type": "ОПРЕДЕЛЕНИЕ",
"document_date": "26 августа 2025 г.",
"judge": "Пикулева Т.И.",
"raw_text": "Исходный текст документа...",
"extraction_timestamp": "2025-09-30T15:55:40.803597"
}
]
Извлекаемые поля
- case_number - номер дела
- execution_number - номер исполнительного листа
- uid - уникальный идентификатор (УИД)
- court - название суда
- plaintiff - ФИО истца
- defendant - ФИО/название ответчика
- document_type - тип документа (ОПРЕДЕЛЕНИЕ, РЕШЕНИЕ, и т.д.)
- document_date - дата документа
- judge - ФИО судьи
Пример использования в n8n
- Создайте SSH node
- Настройте подключение к серверу
- Установите команду:
python3 /var/www/fastuser/data/www/crm.clientright.ru/crm_extensions/court_parser_api.py - Передайте JSON с полем
combinedTextв stdin - Получите структурированные данные в stdout
Тестирование
# Тест с примером
python3 court_document_parser.py --input test_input.json --stdout
Требования
- Python 3.6+
- Стандартные библиотеки Python (json, re, sys, argparse, datetime, typing)