feat: 添加文本修正功能和相关配置选项

- 在 `CreateMeetingCommand` 和 `meeting.ts` 中添加 `enableTextRefine` 字段
- 更新 `AiTaskServiceImpl` 和 `MeetingCommandServiceImpl` 以支持文本修正配置
- 在 `Meetings.tsx` 中添加文本修正的表单选项和默认值
dev_na
chenhao 2026-03-31 10:02:42 +08:00
parent f9c0d31b87
commit 552e2255bd
5 changed files with 11 additions and 1 deletions

View File

@ -20,5 +20,6 @@ public class CreateMeetingCommand {
private Long summaryModelId; private Long summaryModelId;
private Long promptId; private Long promptId;
private Integer useSpkId; private Integer useSpkId;
private Boolean enableTextRefine;
private List<String> hotWords; private List<String> hotWords;
} }

View File

@ -247,6 +247,9 @@ public class AiTaskServiceImpl extends ServiceImpl<AiTaskMapper, AiTask> impleme
Object useSpkObj = taskRecord.getTaskConfig().get("useSpkId"); Object useSpkObj = taskRecord.getTaskConfig().get("useSpkId");
boolean useSpk = useSpkObj != null && useSpkObj.toString().equals("1"); boolean useSpk = useSpkObj != null && useSpkObj.toString().equals("1");
config.put("enable_speaker", useSpk); config.put("enable_speaker", useSpk);
Object enableTextRefineObj = taskRecord.getTaskConfig().get("enableTextRefine");
boolean enableTextRefine = enableTextRefineObj != null && Boolean.parseBoolean(enableTextRefineObj.toString());
config.put("enable_text_refine", enableTextRefine);
config.put("enable_two_pass", true); config.put("enable_two_pass", true);
List<Map<String, Object>> hotwords = new ArrayList<>(); List<Map<String, Object>> hotwords = new ArrayList<>();

View File

@ -60,6 +60,7 @@ public class MeetingCommandServiceImpl implements MeetingCommandService {
Map<String, Object> asrConfig = new HashMap<>(); Map<String, Object> asrConfig = new HashMap<>();
asrConfig.put("asrModelId", command.getAsrModelId()); asrConfig.put("asrModelId", command.getAsrModelId());
asrConfig.put("useSpkId", command.getUseSpkId() != null ? command.getUseSpkId() : 1); asrConfig.put("useSpkId", command.getUseSpkId() != null ? command.getUseSpkId() : 1);
asrConfig.put("enableTextRefine", command.getEnableTextRefine() != null ? command.getEnableTextRefine() : false);
List<String> finalHotWords = command.getHotWords(); List<String> finalHotWords = command.getHotWords();
if (finalHotWords == null || finalHotWords.isEmpty()) { if (finalHotWords == null || finalHotWords.isEmpty()) {

View File

@ -36,6 +36,7 @@ export interface CreateMeetingCommand {
summaryModelId?: number; summaryModelId?: number;
promptId: number; promptId: number;
useSpkId?: number; useSpkId?: number;
enableTextRefine?: boolean;
hotWords?: string[]; hotWords?: string[];
} }

View File

@ -117,7 +117,8 @@ const MeetingCreateForm: React.FC<{
summaryModelId: defaultLlm.data.data?.id, summaryModelId: defaultLlm.data.data?.id,
promptId: activePrompts.length > 0 ? activePrompts[0].id : undefined, promptId: activePrompts.length > 0 ? activePrompts[0].id : undefined,
meetingTime: dayjs(), meetingTime: dayjs(),
useSpkId: 1 useSpkId: 1,
enableTextRefine: false
}); });
} catch (err) {} } catch (err) {}
}; };
@ -243,6 +244,9 @@ const MeetingCreateForm: React.FC<{
<Form.Item name="useSpkId" label={<span> <Tooltip title="开启后将区分不同发言人"><QuestionCircleOutlined /></Tooltip></span>} valuePropName="checked" getValueProps={(v) => ({ checked: v === 1 })} normalize={(v) => (v ? 1 : 0)} style={{ marginBottom: 20 }}> <Form.Item name="useSpkId" label={<span> <Tooltip title="开启后将区分不同发言人"><QuestionCircleOutlined /></Tooltip></span>} valuePropName="checked" getValueProps={(v) => ({ checked: v === 1 })} normalize={(v) => (v ? 1 : 0)} style={{ marginBottom: 20 }}>
<Switch size="small" /> <Switch size="small" />
</Form.Item> </Form.Item>
<Form.Item name="enableTextRefine" label={<span> <Tooltip title="开启后将尝试对识别文本进行修正"><QuestionCircleOutlined /></Tooltip></span>} valuePropName="checked" style={{ marginBottom: 20 }}>
<Switch size="small" />
</Form.Item>
</Card> </Card>
<div style={{ backgroundColor: '#f6ffed', border: '1px solid #b7eb8f', padding: '12px 16px', borderRadius: 12 }}> <div style={{ backgroundColor: '#f6ffed', border: '1px solid #b7eb8f', padding: '12px 16px', borderRadius: 12 }}>