mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-06 20:07:04 +00:00
### What problem does this PR solve? Fix: Issue of ineffective weight adjustment for retrieval_test API-related functions #9854 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
c4f43a395d
commit
e8dcdfb9f0
@ -1,7 +1,7 @@
|
|||||||
export interface ITestRetrievalRequestBody {
|
export interface ITestRetrievalRequestBody {
|
||||||
question: string;
|
question: string;
|
||||||
similarity_threshold: number;
|
similarity_threshold: number;
|
||||||
keywords_similarity_weight: number;
|
vector_similarity_weight: number;
|
||||||
rerank_id?: string;
|
rerank_id?: string;
|
||||||
top_k?: number;
|
top_k?: number;
|
||||||
use_kg?: boolean;
|
use_kg?: boolean;
|
||||||
|
|||||||
@ -12,11 +12,11 @@ import {
|
|||||||
topKSchema,
|
topKSchema,
|
||||||
} from '@/components/rerank';
|
} from '@/components/rerank';
|
||||||
import {
|
import {
|
||||||
initialKeywordsSimilarityWeightValue,
|
|
||||||
initialSimilarityThresholdValue,
|
initialSimilarityThresholdValue,
|
||||||
keywordsSimilarityWeightSchema,
|
initialVectorSimilarityWeightValue,
|
||||||
SimilaritySliderFormField,
|
SimilaritySliderFormField,
|
||||||
similarityThresholdSchema,
|
similarityThresholdSchema,
|
||||||
|
vectorSimilarityWeightSchema,
|
||||||
} from '@/components/similarity-slider';
|
} from '@/components/similarity-slider';
|
||||||
import { ButtonLoading } from '@/components/ui/button';
|
import { ButtonLoading } from '@/components/ui/button';
|
||||||
import {
|
import {
|
||||||
@ -52,16 +52,18 @@ export default function TestingForm({
|
|||||||
message: t('knowledgeDetails.testTextPlaceholder'),
|
message: t('knowledgeDetails.testTextPlaceholder'),
|
||||||
}),
|
}),
|
||||||
...similarityThresholdSchema,
|
...similarityThresholdSchema,
|
||||||
...keywordsSimilarityWeightSchema,
|
...vectorSimilarityWeightSchema,
|
||||||
...topKSchema,
|
...topKSchema,
|
||||||
|
use_kg: z.boolean().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof formSchema>>({
|
const form = useForm<z.infer<typeof formSchema>>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
...initialSimilarityThresholdValue,
|
...initialSimilarityThresholdValue,
|
||||||
...initialKeywordsSimilarityWeightValue,
|
...initialVectorSimilarityWeightValue,
|
||||||
...initialTopKValue,
|
...initialTopKValue,
|
||||||
|
use_kg: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -82,7 +84,6 @@ export default function TestingForm({
|
|||||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
||||||
<FormContainer className="p-10">
|
<FormContainer className="p-10">
|
||||||
<SimilaritySliderFormField
|
<SimilaritySliderFormField
|
||||||
vectorSimilarityWeightName="keywords_similarity_weight"
|
|
||||||
isTooltipShown={true}
|
isTooltipShown={true}
|
||||||
></SimilaritySliderFormField>
|
></SimilaritySliderFormField>
|
||||||
<RerankFormFields></RerankFormFields>
|
<RerankFormFields></RerankFormFields>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user