Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

certainty parameter not found in The qna-openai module #50

Open
chuck1in opened this issue May 5, 2023 · 0 comments
Open

certainty parameter not found in The qna-openai module #50

chuck1in opened this issue May 5, 2023 · 0 comments

Comments

@chuck1in
Copy link

chuck1in commented May 5, 2023

https://weaviate.io/developers/weaviate/modules/reader-generator-modules/qna-openai

The qna-openai module tries to find an answer in the data objects of the specified class. If an answer is found within the given certainty range, it will be returned in the GraphQL _additional { answer { ... } } field. There will be a maximum of 1 answer returned, if this is above the optionally set certainty. The answer with the highest certainty (confidence level) will be returned.

  1. How can I use the certainty parameter to filter out irrelevant questions when using the question and answer module with OpenAI?
  2. And if certainty parameter is supported, is certainty:0.75 be properly when I want to return empty when users ask questions that are unrelated to the extracted article content?

Here is my code block

client.graphql
		.get()
		.withClassName(schema)
		.withAsk({
			question: question
		})
		.withFields(
			'content _additional { answer { hasAnswer property result startPosition endPosition } }'
		)
		.withLimit(1)
		.do()
		.then((res: any) => {
			console.log(JSON.stringify(res, null, 2))
			return res.data.Get[schema][0]._additional.answer.result
		})
@chuck1in chuck1in closed this as completed May 5, 2023
@chuck1in chuck1in reopened this May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant