Upload web/src/controllers/DocumentController.php with huggingface_hub
Browse files
web/src/controllers/DocumentController.php
CHANGED
|
@@ -89,13 +89,14 @@ class DocumentController
|
|
| 89 |
$keywords = [];
|
| 90 |
}
|
| 91 |
|
| 92 |
-
// Forensic metadata
|
| 93 |
$forensic = [];
|
| 94 |
$redactionSummary = null;
|
|
|
|
| 95 |
try {
|
| 96 |
$forensicRows = $db->fetchAll(
|
| 97 |
"SELECT feature_name, feature_json FROM document_features
|
| 98 |
-
WHERE document_id = :docId AND feature_name IN ('forensic_metadata', 'redaction_summary')",
|
| 99 |
['docId' => $docId]
|
| 100 |
);
|
| 101 |
foreach ($forensicRows as $row) {
|
|
@@ -103,6 +104,8 @@ class DocumentController
|
|
| 103 |
$forensic = json_decode($row['feature_json'], true) ?: [];
|
| 104 |
} elseif ($row['feature_name'] === 'redaction_summary') {
|
| 105 |
$redactionSummary = json_decode($row['feature_json'], true) ?: [];
|
|
|
|
|
|
|
| 106 |
}
|
| 107 |
}
|
| 108 |
} catch (\PDOException $e) {
|
|
|
|
| 89 |
$keywords = [];
|
| 90 |
}
|
| 91 |
|
| 92 |
+
// Forensic metadata, redaction summary, sentiment
|
| 93 |
$forensic = [];
|
| 94 |
$redactionSummary = null;
|
| 95 |
+
$sentiment = null;
|
| 96 |
try {
|
| 97 |
$forensicRows = $db->fetchAll(
|
| 98 |
"SELECT feature_name, feature_json FROM document_features
|
| 99 |
+
WHERE document_id = :docId AND feature_name IN ('forensic_metadata', 'redaction_summary', 'sentiment')",
|
| 100 |
['docId' => $docId]
|
| 101 |
);
|
| 102 |
foreach ($forensicRows as $row) {
|
|
|
|
| 104 |
$forensic = json_decode($row['feature_json'], true) ?: [];
|
| 105 |
} elseif ($row['feature_name'] === 'redaction_summary') {
|
| 106 |
$redactionSummary = json_decode($row['feature_json'], true) ?: [];
|
| 107 |
+
} elseif ($row['feature_name'] === 'sentiment') {
|
| 108 |
+
$sentiment = json_decode($row['feature_json'], true) ?: [];
|
| 109 |
}
|
| 110 |
}
|
| 111 |
} catch (\PDOException $e) {
|