SpaceYL commited on
Commit
238bc6b
·
verified ·
1 Parent(s): f4e5cbd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -1
README.md CHANGED
@@ -85,4 +85,24 @@ For each component, the dataset covers five main technical aspects:
85
  "theme": "question_simple",
86
  "source": "gemini_api"
87
  }
88
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  "theme": "question_simple",
86
  "source": "gemini_api"
87
  }
88
+ }
89
+
90
+ ## How to Use
91
+ You can load the model using Hugging Face's `transformers` library:
92
+
93
+ ```python
94
+ import json
95
+
96
+ # Load the dataset
97
+ with open("dataset_composants_simples.json", "r", encoding="utf-8") as f:
98
+ dataset = json.load(f)
99
+
100
+ # Example: Extract a question-answer pair
101
+ sample = dataset[0]
102
+ question = next(msg["content"] for msg in sample["messages"] if msg["role"] == "user")
103
+ answer = next(msg["content"] for msg in sample["messages"] if msg["role"] == "assistant")
104
+ component = sample["metadata"]["component_name"]
105
+
106
+ print(f"Component: {component}")
107
+ print(f"Question: {question}")
108
+ print(f"Answer: {answer}")