- 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.
40 lines
1.8 KiB
PHP
40 lines
1.8 KiB
PHP
<?php
|
||
// aiassist/ner.php
|
||
|
||
/**
|
||
* Функция извлечения ключевых данных из текста.
|
||
* В реальной реализации здесь можно вызвать Python-скрипт через shell_exec или REST API.
|
||
*/
|
||
|
||
/**
|
||
* Извлекает ключевые данные (истец, ответчик, суть спора) из текста с использованием Python‑скрипта на Natasha.
|
||
*
|
||
* @param string $text Исходный текст для анализа.
|
||
* @return array Ассоциативный массив с ключами 'истец', 'ответчик' и 'суть_спора'.
|
||
*/
|
||
function extractCaseDetails2($text) {
|
||
// Экранируем текст для безопасной передачи в командной строке
|
||
$escapedText = escapeshellarg($text);
|
||
|
||
// Определяем путь к Python-скрипту (предполагается, что он лежит в той же директории)
|
||
$scriptPath = __DIR__ . '/ner_extraction.py';
|
||
|
||
// Формируем команду для вызова Python-скрипта
|
||
$command = "python3 " . escapeshellarg($scriptPath) . " " . $escapedText;
|
||
$output = shell_exec($command);
|
||
|
||
// Преобразуем вывод (JSON) в ассоциативный массив
|
||
$result = json_decode($output, true);
|
||
if (!$result) {
|
||
// Если произошла ошибка, возвращаем значения по умолчанию
|
||
return [
|
||
'истец' => 'Не определено',
|
||
'ответчик' => 'Не определено',
|
||
'суть_спора' => 'Не определено'
|
||
];
|
||
}
|
||
return $result;
|
||
}
|
||
?>
|
||
|