You can use the Binoculars class to compute a detection score or get a direct prediction for a string or a list of strings.
By default, the implementation uses a fixed global threshold based on Falcon-7B and Falcon-7B-Instruct models. If you need to use different scoring models, you can pass them as an argument when initializing the Binoculars class.
Methods:
compute_score(text): Returns a numerical score indicating the likelihood of the text being AI-generated.predict(text): Returns a string label (e.g., 'Most likely AI-Generated') based on the internal threshold.
Both methods support passing a single str or a list of str for batch processing.
from binoculars import Binoculars
bino = Binoculars()
sample_string = "'Your text here'"
# Get the numerical score
print(bino.compute_score(sample_string))
# Get the classification label
print(bino.predict(sample_string))