Views
No views yet
| Feature | Description |
|---|---|
char_count | Total number of characters |
word_count | Total number of words |
avg_word_len | Average word length |
punct_count | Number of punctuation characters |
sentence_count | Number of sentences |
avg_sentence_len | Average sentence length (in words) |
upper_case_count | Number of fully uppercase alphabetic words |
title_case_count | Number of title-case words |
| Class | Precision | Recall | F1-score | Support |
|---|---|---|---|---|
| Human (0) | 0.96 | 0.98 | 0.97 | 61,112 |
| AI (1) | 0.97 | 0.92 | 0.95 | 36,335 |
| Weighted avg | 0.96 | 0.96 | 0.96 | 97,447 |
pip install stylometric-ai-detector1from stylometric_ai_detector import extract_stylometric_features, predict
2
3# Extract features
4features = extract_stylometric_features("Your text here...")
5
6# Predict AI vs Human
7result = predict(text="Your text here...")
8# {"label": "AI", "probability": 0.87}1import joblib
2from huggingface_hub import hf_hub_download
3
4path = hf_hub_download(
5 repo_id="dinisds/stylometric-ai-detector",
6 filename="random_forest_stylometric_model.joblib",
7)
8model = joblib.load(path)1FEATURES = [
2 "char_count", "word_count", "avg_word_len", "punct_count",
3 "sentence_count", "avg_sentence_len", "upper_case_count", "title_case_count",
4]
5# model.predict([[char_count, word_count, avg_word_len, punct_count,
6# sentence_count, avg_sentence_len, upper_case_count, title_case_count]])
7# 0 = Human, 1 = AIstylometric-ai-detector Python package:pip install stylometric-ai-detector1from stylometric_ai_detector import predict
2result = predict(text="Your text here...")