Кейс 2. Финтех – автоматический анализ транзакционных сообщений
Сценарий
Transfer of $8500 was sent to Michael Brown in New York on January 5.Чистый PHP + REST API
function analyzeTransaction(string $text): array
{
$payload = json_encode(["inputs" => $text]);
$ch = curl_init("https://api.example.com/ner");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer TOKEN"
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
$text = "Transfer of $8500 was sent to Michael Brown in New York on January 5.";
$result = analyzeTransaction($text);
print_r($result);Почему это лучше регулярок
PreviousКейс 1. Автоматический разбор договора (Legal / CRM)NextКейс 3. Автоматическое построение базы контактов из email
Last updated