Views
No views yet
cear_model.py) and the platform weights (platform_weights.json).platform_weights.json.)cear_model.py) and the application interface (app.py) for a Hugging Face Space.1import pandas as pd
2from cear_model import CEARModel
3
4# Example Input Data
5user_data = pd.DataFrame([
6 {'platform_name': 'TikTok', 'minutes_per_week': 450},
7 {'platform_name': 'YouTube', 'minutes_per_week': 200},
8 {'platform_name': 'Reddit', 'minutes_per_week': 50},
9])
10
11model = CEARModel()
12results = model.calculate_scores(user_data)
13# {'C_Score': 3.75, 'A_Risk': 565.0, ...}
14
15# Application Interface (The App - app.py)
16
17The app.py script uses the Gradio library to create an interactive web interface. It handles:
18
19 Collecting user input via a table component.
20
21 Calling the CEARModel.calculate_scores() method.
22
23 Generating a qualitative natural language summary based on the quadrant of the C-Score and A-Risk (e.g., "High C, Low A").
24
25⚠️ Limitations and Ethical Considerations
26
271. Theoretical, Not Validated: The scores are based on fixed, theoretical assumptions about platform design. They are not calibrated against real-world user survey data or outcomes (e.g., actual cultural literacy, actual regret). Scores are relative estimates only.
28
292. No Content Analysis: The model only uses time and platform. It cannot distinguish between a productive hour watching educational content and an unproductive hour scrolling low-quality content.
30
313. Future Work: This deterministic model serves as a foundation. Future versions are intended to use the same input schema to train supervised machine learning models that directly predict outcomes (e.g., predicting user-reported "felt caught up" or "post-scroll regret").
32
33
34---
35
36## 2. `requirements.txt` (For Deployment)
37
38This file lists the necessary Python packages for the Gradio Space to run your model and interface correctly.
39
40```text
41# requirements.txt
42
43# Core Model Dependencies
44pandas
45numpy
46
47# Gradio Space Dependencies
48# Gradio is used to build the simple web application interface (app.py)
49gradio