feat: add determinisic slot filling (keyword and patter lookup strategies)

This commit is contained in:
Mohamed Marrouchi
2025-05-13 12:12:40 +01:00
parent 946d940370
commit 6e89192f88
7 changed files with 373 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ const getDefaultNlpMetadata = (
if (nlpEntity?.lookups.includes(LookupStrategy.pattern)) {
return {
pattern: "//",
wordBoundary: true,
removeSpaces: false,
toLowerCase: false,
stripDiacritics: false,
@@ -160,6 +161,18 @@ export const NlpValueForm: FC<ComponentFormProps<INlpValue, INlpEntity>> = ({
flags={["i"]}
/>
</ContentItem>
<ContentItem>
<Controller
name="metadata.wordBoundary"
control={control}
render={({ field }) => (
<FormControlLabel
control={<Switch {...field} checked={field.value} />}
label={t("label.word_boundary")}
/>
)}
/>
</ContentItem>
<ContentItem>
<Controller
name="metadata.removeSpaces"

View File

@@ -23,6 +23,7 @@ export type Lookup = `${LookupStrategy}`;
export interface INlpMetadata {
// Required when lookups is "pattern"
pattern?: string;
wordBoundary?: boolean;
removeSpaces?: boolean;
toLowerCase?: boolean;
stripDiacritics?: boolean;