Spaces:
Configuration error
Configuration error
from scoring.corpus import corpus_score, corpus_recommendation | |
from scoring.structure import structure_score, structure_recommendation | |
from scoring.quality import quality_score, quality_recommendation | |
from scoring.hygiene import hygiene_score, hygiene_recommendation | |
def compute_full_geo(input_text: str) -> dict: | |
""" | |
Combine all four scoring modules. Compute: | |
- corpus_score (0β100) | |
- structure_score (0β100) | |
- quality_score (0β100) | |
- hygiene_score (0β100) | |
- geo_score = average of all four | |
- recommendations: dict with four strings | |
""" | |
# 1. Corpus Presence & Authority | |
c_score = corpus_score(input_text) | |
c_rec = corpus_recommendation(input_text, c_score) | |
# 2. Extractability & Structure | |
s_score = structure_score(input_text) | |
s_rec = structure_recommendation(input_text, s_score) | |
# 3. Content Quality & E-E-A-T | |
q_score = quality_score(input_text) | |
q_rec = quality_recommendation(input_text, q_score) | |
# 4. Technical AI-Crawl Hygiene | |
h_score = hygiene_score(input_text) | |
h_rec = hygiene_recommendation(input_text, h_score) | |
# Weighted GEO Score (equal 25% each) | |
geo_score = int( | |
0.25 * c_score + | |
0.25 * s_score + | |
0.25 * q_score + | |
0.25 * h_score | |
) | |
recommendations = { | |
"corpus": c_rec, | |
"structure": s_rec, | |
"quality": q_rec, | |
"hygiene": h_rec | |
} | |
return { | |
"corpus_score": c_score, | |
"structure_score": s_score, | |
"quality_score": q_score, | |
"hygiene_score": h_score, | |
"geo_score": geo_score, | |
"recommendations": recommendations | |
} | |