Browse Source

Merge pull request #2380 from visuddhinanda/development

Development
visuddhinanda 2 days ago
parent
commit
f53d7237b1

+ 6 - 2
api-v13/app/Console/Commands/ExportAiTrainingData.php

@@ -114,7 +114,8 @@ class ExportAiTrainingData extends Command
                 'word_start',
                 'word_end',
                 'content',
-                'content_type'
+                'content_type',
+                'updated_at'
             ])
                 ->whereNotNull('content')
                 ->orderBy('book_id')
@@ -145,7 +146,7 @@ class ExportAiTrainingData extends Command
                     'read',
                     'translation',
                     $sent->content_type,
-                    'text',
+                    'html',
                 );
                 $translation = trim($translation);
                 // 忽略空的译文
@@ -155,10 +156,12 @@ class ExportAiTrainingData extends Command
                 }
 
                 //忽略过短的译文
+                /*
                 if (mb_strlen($translation) / mb_strlen($origin) < $this->ShortTrans) {
                     Log::warning('translation is short id=' . $id);
                     continue;
                 }
+                */
                 //原文与翻译完全相同
                 if ($translation === $origin) {
                     Log::warning('translation is same id=' . $id);
@@ -174,6 +177,7 @@ class ExportAiTrainingData extends Command
                     'translation' => $translation,
                     'category' => $tags,
                     'path' => $path,
+                    'updated_at' => $sent->updated_at
                 ];
 
                 fwrite($fp, json_encode($currData, JSON_UNESCAPED_UNICODE) . "\n");

+ 2 - 1
api-v13/app/Http/Controllers/HealthCheckController.php

@@ -79,7 +79,8 @@ class HealthCheckController extends Controller
             [
                 'createdAt' => now(),
                 'services' => $checks,
-                'host' => $_SERVER['HTTP_HOST']
+                'host' => $_SERVER['HTTP_HOST'],
+                'document-root' => $_SERVER['DOCUMENT_ROOT']
             ],
             $healthy ? 200 : 500,
             ['Content-Type' => 'application/json;charset=UTF-8', 'Charset' => 'utf-8'],