You've already forked DataMate
feat(annotation): 添加文本分段标注功能
- 引入文本分割器实现长文本按200字符自动分段 - 增加分段状态管理和段落导航界面 - 支持按段落保存和加载标注数据 - 实现分段模式下的标注状态跟踪 - 扩展API接口支持段落索引参数 - 添加分段相关的数据模型定义
This commit is contained in:
@@ -9,6 +9,8 @@ Label Studio Editor(前端嵌入式)接口
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import APIRouter, Depends, Query, Path
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
@@ -67,10 +69,11 @@ async def list_editor_tasks(
|
||||
async def get_editor_task(
|
||||
project_id: str = Path(..., description="标注项目ID(t_dm_labeling_projects.id)"),
|
||||
file_id: str = Path(..., description="文件ID(t_dm_dataset_files.id)"),
|
||||
segment_index: Optional[int] = Query(None, alias="segmentIndex", description="段落索引(分段模式下使用)"),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
service = AnnotationEditorService(db)
|
||||
task = await service.get_task(project_id, file_id)
|
||||
task = await service.get_task(project_id, file_id, segment_index=segment_index)
|
||||
return StandardResponse(code=200, message="success", data=task)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user