This is really easy to set up - and is much more accurate than asking the LLM to predict True/False.
Just feed the outputs of an embedding API into logistic regression, e.g. from sklearn.
import voyageai
vo = voyageai.Client()
# This will automatically use the environment variable VOYAGE_API_KEY.
# Alternatively, you can use vo = voyageai.Client(api_key="<your secret key>")
texts = ["Sample text 1", "Sample text 2"]
result = vo.embed(texts, model="voyage-2", input_type="document")
print(result.embeddings[0])
Just feed the outputs of an embedding API into logistic regression, e.g. from sklearn.
https://scikit-learn.org/1.5/modules/generated/sklearn.linea...