|
14 | 14 | "This validator checks if a text is related with a topic. Using a list of valid topics (which can include one or many) and optionally a list of invalid topics, it validates that the text's main topic is one of the valid ones. If none of the valid topics are relevant, the topic 'Other' will be considered as the most relevant one and the validator will fail.\n", |
15 | 15 | "\n", |
16 | 16 | "The validator supports 3 different variants:\n", |
17 | | - "- Using an ensemble of Zero-Shot classifier + LLM fallback: if the original classification score is less than 0.5, an LLM is used to classify the main topic. This is the default behavior, setting `disable_classifier = False` and `disable_llm = False`.\n", |
18 | | - "- Using just a Zero-Shot classifier to get the main topic (`disable_classifier = False` and `disable_llm = True`).\n", |
19 | | - "- Using just an LLM to classify the main topic (`disable_classifier = True` and `disable_llm = False`).\n", |
| 17 | + "\n", |
| 18 | + "1. Using an ensemble of Zero-Shot classifier + LLM fallback: if the original classification score is less than 0.5, an LLM is used to classify the main topic. This is the default behavior, setting `disable_classifier = False` and `disable_llm = False`.\n", |
| 19 | + "2. Using just a Zero-Shot classifier to get the main topic (`disable_classifier = False` and `disable_llm = True`).\n", |
| 20 | + "3. Using just an LLM to classify the main topic (`disable_classifier = True` and `disable_llm = False`).\n", |
20 | 21 | "\n", |
21 | 22 | "To use the LLM, you can pass in a name of any OpenAI ChatCompletion model like `gpt-3.5-turbo` or `gpt-4` as the `llm_callable`, or pass in a callable that handles LLM calls. This callable can use any LLM, that you define. For simplicity purposes, we show here a demo of using OpenAI's gpt-3.5-turbo model.\n", |
22 | 23 | "\n", |
23 | 24 | "To use the OpenAI API, you have 3 options:\n", |
24 | 25 | "\n", |
25 | | - "- Set the OPENAI_API_KEY environment variable: os.environ[\"OPENAI_API_KEY\"] = \"<OpenAI_API_KEY>\"\n", |
26 | | - "- Set the OPENAI_API_KEY using openai.api_key=\"<OpenAI_API_KEY>\"\n", |
27 | | - "- Pass the api_key as a parameter to the parse function as done below, in this example" |
| 26 | + "1. Set the OPENAI_API_KEY environment variable: os.environ[\"OPENAI_API_KEY\"] = \"<OpenAI_API_KEY>\"\n", |
| 27 | + "2. Set the OPENAI_API_KEY using openai.api_key=\"<OpenAI_API_KEY>\"\n", |
| 28 | + "3. Pass the api_key as a parameter to the parse function" |
28 | 29 | ] |
29 | 30 | }, |
30 | 31 | { |
|
0 commit comments