feat(annotation): 添加 JSONL 文件支持和文本键解析功能

- 添加 JSONL 文件扩展名常量定义
- 实现主文本键解析方法 _resolve_primary_text_key
- 添加 JSONL 记录解析方法 _parse_jsonl_records
- 修改任务数据构建方法以支持主文本键参数
- 实现主文本值解析方法 _resolve_primary_text_value
- 更新项目信息获取逻辑以支持 JSONL 多行记录处理
- 修改分段逻辑以支持 JSONL 多行或超长文本分段
- 调整标注处理逻辑以正确处理分段标注场景
This commit is contained in:
2026-01-23 22:04:34 +08:00
parent 8e06a36460
commit 0e30e658e9
3 changed files with 118 additions and 31 deletions

View File

@@ -38,6 +38,8 @@ type SegmentInfo = {
start: number;
end: number;
hasAnnotation: boolean;
lineIndex: number;
chunkIndex: number;
};
type ApiResponse<T> = {
@@ -726,9 +728,9 @@ export default function LabelStudioTextEditor() {
type={seg.idx === currentSegmentIndex ? "primary" : "default"}
onClick={() => handleSegmentChange(seg.idx)}
disabled={segmentSwitching || saving || loadingTaskDetail || !lsReady}
style={{ minWidth: 32, padding: "0 8px" }}
style={{ minWidth: 64, padding: "0 6px" }}
>
{seg.idx + 1}
{`${seg.lineIndex + 1}/片${seg.chunkIndex + 1}`}
{seg.hasAnnotation && (
<CheckOutlined style={{ marginLeft: 2, fontSize: 10 }} />
)}