Instructions to use Clementio/PLRS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Clementio/PLRS with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Clementio/PLRS", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -239,16 +239,21 @@ def main():
|
|
| 239 |
seq_length=st.slider('Sequence Length',10,200,50)
|
| 240 |
seed=st.number_input('Student Seed',1,1000,42,1)
|
| 241 |
np.random.seed(int(seed))
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
if st.button('๐ Generate Recommendations', type='primary'):
|
| 253 |
output=pipeline.run(mastery_vector)
|
| 254 |
summary=mastery_vector.get_mastery_summary()
|
|
|
|
| 239 |
seq_length=st.slider('Sequence Length',10,200,50)
|
| 240 |
seed=st.number_input('Student Seed',1,1000,42,1)
|
| 241 |
np.random.seed(int(seed))
|
| 242 |
+
topic_nodes = list(graph.nodes)
|
| 243 |
+
n_topics = len(topic_nodes)
|
| 244 |
+
raw_scores = np.random.beta(1.5, 3.0, size=n_topics)
|
| 245 |
+
scale = min(seq_length / 200.0 * 1.4, 1.0)
|
| 246 |
+
scores = np.clip(raw_scores * scale, 0.0, 1.0)
|
| 247 |
+
for topic_id, score in zip(topic_nodes, scores):
|
| 248 |
+
mastery_vector.update(topic_id, float(score))
|
| 249 |
+
mastery_df = pd.DataFrame({
|
| 250 |
+
'Topic': [graph.nodes[t].get('label', t)[:25] for t in topic_nodes],
|
| 251 |
+
'Mastery': [round(float(s), 3) for s in scores]
|
| 252 |
+
}).sort_values('Mastery', ascending=False).head(10)
|
| 253 |
+
st.markdown('**๐ Simulated Learner Mastery Signal (top 10 topics):**')
|
| 254 |
+
st.bar_chart(mastery_df.set_index('Topic'))
|
| 255 |
+
n_mastered = sum(1 for s in scores if s >= threshold)
|
| 256 |
+
st.success(f'Learner simulation complete โ {n_mastered}/{n_topics} topics above mastery threshold')
|
| 257 |
if st.button('๐ Generate Recommendations', type='primary'):
|
| 258 |
output=pipeline.run(mastery_vector)
|
| 259 |
summary=mastery_vector.get_mastery_summary()
|