mukmukmukmuk commited on
Commit
ba0ba18
Β·
verified Β·
1 Parent(s): 6625308

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -14
README.md CHANGED
@@ -1,3 +1,4 @@
 
1
  ---
2
  library_name: keras
3
  license: mit
@@ -9,10 +10,10 @@ base_model:
9
 
10
  # Icebreaking Quiz Generation Model
11
 
12
- This model is designed to generate icebreaking quizzes. Icebreaking refers to activities conducted before meetings to help participants break the ice and ease tension by solving simple quizzes. By inputting simple, easy-to-answer questions along with users' responses into this model, it generates new four-option multiple-choice questions, options, and the correct answer. These customized questions can help participants engage with each other and reduce awkwardness in the room.
13
 
14
  ## 1. Data Collection
15
- We collected questions and answers from blogs through web crawling and used state-of-the-art models like ChatGPT to generate new four-option multiple-choice questions. We then manually reviewed and edited the generated questions to correct any errors in answer matching and adjusted the difficulty level of the options to make the multiple-choice questions more challenging. This process resulted in the creation of a well-structured dataset.
16
 
17
  **Example Data**
18
 
@@ -20,9 +21,8 @@ We collected questions and answers from blogs through web crawling and used stat
20
  |---------|-------------------------------|-----------------|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|---------------------------------------------------------------------|-----------------|
21
  | gemma | μ‚΄λ©΄μ„œ κ°€μž₯ 기얡에 λ‚¨λŠ” μ‚¬λžŒ | 95 | λ―Έμˆ ν•™μ› μ„ μƒλ‹˜! λ‚΄κ°€ 미술 μͺ½μ— ν₯λ―Έλ₯Ό κ°€μ§ˆ 수 있게 도와주신 뢄이야. 학ꡐ λλ‚˜κ³  학원에 κ°€λ©΄ λ§›λ‚œ 것도 많이 μ£Όμ‹œκ³  쒋은 κΈ°μ–΅λ“€λ§Œ λ§Œλ“€μ–΄μ£Όμ‹  뢄이야. | 이 μ‚¬λžŒμ΄ μ΄ˆλ“±ν•™κ΅ λ•Œ κ°€μž₯ 기얡에 λ‚¨λŠ” μ‚¬λžŒμ€ λˆ„κ΅¬μΈκ°€μš”? | 1. μ΄ˆλ“±ν•™κ΅ λ‹΄μž„ μ„ μƒλ‹˜ 2. 쀑학ꡐ 동창 3. λ―Έμˆ ν•™μ› μ„ μƒλ‹˜ 4. λŒ€ν•™κ΅ ꡐ수 | 3 |
22
 
23
-
24
  ## 2. Fine-tuning Process
25
- This model is fine-tuned using the Google Gemma 2B instruct model, with LoRA applied to make the training process lighter and faster on TPU. LoRA reduces the number of parameters updated during training, allowing efficient fine-tuning without consuming excessive memory resources. Early stopping was also applied to prevent overfitting.
26
 
27
  The training was conducted on a JAX backend using TPU acceleration, distributing the workload across multiple TPU cores for improved efficiency. The model was optimized using the AdamW optimizer, and the loss function was calculated using sparse categorical cross-entropy.
28
 
@@ -31,23 +31,23 @@ The training was conducted on a JAX backend using TPU acceleration, distributing
31
  - **Sequence Length**: 512
32
  - **Batch Size**: 16
33
  - **LoRA Rank**: 8
34
- - **Learning rate**: 2e-5
35
  - **Epochs**: 20
36
  - **Train Data Rate**: 0.9
37
  - **Early Stopping Step**: 5
38
 
39
  **Training Method:**
40
 
41
- The training data consists of "question_crawling" and "answer_crawling" columns as inputs, with "question_generated", "multiple_choice_generated", and "answer_generated" columns as outputs. The data was formatted to fit the fine-tuned model's input structure, and training proceeded accordingly.
42
 
43
- The model is built using Keras_NLP's pre-built `GemmaCausalLM` and applied to the Gemma 2B instruct architecture. We activated LoRA on the decoder blocks and efficiently managed the model across TPU devices through model parallelization. Training was conducted for 20 epochs using TPU resources on Kaggle.
44
 
45
  **Training Time and Results:**
46
 
47
  - Training ran for 20 epochs with a batch size of 16.
48
  - Time per epoch: ~5 minutes (with TPU)
49
  - Total training time: ~100 minutes
50
- - The model showed high accuracy in quiz generation, achieving approximately 81% accuracy on the validation data.
51
 
52
  **Generated Example:**
53
  ```
@@ -61,17 +61,36 @@ The model is built using Keras_NLP's pre-built `GemmaCausalLM` and applied to th
61
  1. ν•΄μ™Έ μ—¬ν–‰ 2. μ—°μ•  3. μŠ€μΉ΄μ΄λ‹€μ΄λΉ™ 4. λ§ˆλΌν†€
62
  2
63
  ```
 
 
 
64
  ## Model Usage:
65
 
66
- This model has been developed as a service using the Flask framework and Google Survey, allowing real users to utilize it for icebreaking. Users can respond to simple questions on Google Survey, and the model generates new questions based on their input. Flask processes the question generation, while a 'conversation topic guide' is provided to facilitate discussions while waiting for the generated questions.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  **Deployment Platform:**
69
  - Supported backends: JAX, TensorFlow, PyTorch
70
 
71
- **Service link:** [http://64.110.84.104:7860](http://64.110.84.104:7860)
72
- **Code link:** [https://huggingface.co/spaces/yunzi7/icebreaking/tree/main](https://huggingface.co/spaces/yunzi7/icebreaking/tree/main)
73
-
74
 
75
- For more details about the model architecture, check out
76
- [config.json](./config.json).
77
 
 
1
+
2
  ---
3
  library_name: keras
4
  license: mit
 
10
 
11
  # Icebreaking Quiz Generation Model
12
 
13
+ This model is designed to generate icebreaking quizzes. Icebreaking refers to activities conducted before meetings to help participants break the ice and ease tension by solving simple quizzes. By inputting easy-to-answer questions along with users' responses into the model, it generates new multiple-choice questions with four options and the correct answer. These customized questions can help participants engage with each other and reduce awkwardness in the room.
14
 
15
  ## 1. Data Collection
16
+ We collected questions and answers from blogs via web crawling and used state-of-the-art models like ChatGPT to generate new four-option multiple-choice questions. We then manually reviewed and edited the generated questions to correct any errors in answer matching and adjusted the difficulty level to make the multiple-choice options more challenging. This process resulted in a well-structured dataset.
17
 
18
  **Example Data**
19
 
 
21
  |---------|-------------------------------|-----------------|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|---------------------------------------------------------------------|-----------------|
22
  | gemma | μ‚΄λ©΄μ„œ κ°€μž₯ 기얡에 λ‚¨λŠ” μ‚¬λžŒ | 95 | λ―Έμˆ ν•™μ› μ„ μƒλ‹˜! λ‚΄κ°€ 미술 μͺ½μ— ν₯λ―Έλ₯Ό κ°€μ§ˆ 수 있게 도와주신 뢄이야. 학ꡐ λλ‚˜κ³  학원에 κ°€λ©΄ λ§›λ‚œ 것도 많이 μ£Όμ‹œκ³  쒋은 κΈ°μ–΅λ“€λ§Œ λ§Œλ“€μ–΄μ£Όμ‹  뢄이야. | 이 μ‚¬λžŒμ΄ μ΄ˆλ“±ν•™κ΅ λ•Œ κ°€μž₯ 기얡에 λ‚¨λŠ” μ‚¬λžŒμ€ λˆ„κ΅¬μΈκ°€μš”? | 1. μ΄ˆλ“±ν•™κ΅ λ‹΄μž„ μ„ μƒλ‹˜ 2. 쀑학ꡐ 동창 3. λ―Έμˆ ν•™μ› μ„ μƒλ‹˜ 4. λŒ€ν•™κ΅ ꡐ수 | 3 |
23
 
 
24
  ## 2. Fine-tuning Process
25
+ This model was fine-tuned using the Google Gemma 2B instruct model, with LoRA applied to make the training process lighter and faster on TPU. LoRA reduces the number of parameters updated during training, allowing efficient fine-tuning without consuming excessive memory resources. Early stopping was also applied to prevent overfitting.
26
 
27
  The training was conducted on a JAX backend using TPU acceleration, distributing the workload across multiple TPU cores for improved efficiency. The model was optimized using the AdamW optimizer, and the loss function was calculated using sparse categorical cross-entropy.
28
 
 
31
  - **Sequence Length**: 512
32
  - **Batch Size**: 16
33
  - **LoRA Rank**: 8
34
+ - **Learning Rate**: 2e-5
35
  - **Epochs**: 20
36
  - **Train Data Rate**: 0.9
37
  - **Early Stopping Step**: 5
38
 
39
  **Training Method:**
40
 
41
+ The training data consists of "question_crawling" and "answer_crawling" columns as inputs, with "question_generated", "multiple_choice_generated", and "answer_generated" columns as outputs. The data was formatted to fit the fine-tuned model's input structure for training.
42
 
43
+ The model is built using Keras_NLP's pre-built `GemmaCausalLM` and applied to the Gemma 2B instruct architecture. We activated LoRA on the decoder blocks and managed the model efficiently across TPU devices via model parallelization. Training was conducted for 20 epochs using TPU resources on Kaggle.
44
 
45
  **Training Time and Results:**
46
 
47
  - Training ran for 20 epochs with a batch size of 16.
48
  - Time per epoch: ~5 minutes (with TPU)
49
  - Total training time: ~100 minutes
50
+ - The model demonstrated high accuracy in quiz generation, achieving approximately 81% accuracy on the validation data.
51
 
52
  **Generated Example:**
53
  ```
 
61
  1. ν•΄μ™Έ μ—¬ν–‰ 2. μ—°μ•  3. μŠ€μΉ΄μ΄λ‹€μ΄λΉ™ 4. λ§ˆλΌν†€
62
  2
63
  ```
64
+
65
+ **Kaggle Notebook**: [https://www.kaggle.com/code/mukmukmukmuk/v2-fine-tune-2b-icebreaking-quiz-tpu/notebook](https://www.kaggle.com/code/mukmukmukmuk/v2-fine-tune-2b-icebreaking-quiz-tpu/notebook)
66
+
67
  ## Model Usage:
68
 
69
+ When using this model, data must be formatted according to a specific template. The following structure is required for input:
70
+
71
+ ```plaintext
72
+ <instruction>
73
+ Using the text: {question_crawling} {answer_crawling}, create a new multiple-choice question with 4 answer options.
74
+ ```
75
+
76
+ The model takes the `question_crawling` and `answer_crawling` data to generate new multiple-choice questions. The expected format for the generated output is:
77
+
78
+ ```plaintext
79
+ <Response>
80
+ {question_generated}
81
+ {multiple_choice_generated}
82
+ {answer_generated}
83
+ ```
84
+
85
+ This template includes the newly generated question, multiple-choice options, and the correct answer. When using this template for testing, the fields for `question_generated`, `multiple_choice_generated`, and `answer_generated` are left blank for the model to fill in.
86
+
87
+ This model has been developed as a service using the Flask framework and Google Survey, allowing real users to utilize it for icebreaking. Users respond to simple questions on Google Survey, and the model generates new questions based on their input. Flask processes the question generation, while a 'conversation topic guide' is provided to facilitate discussions while waiting for the generated questions.
88
 
89
  **Deployment Platform:**
90
  - Supported backends: JAX, TensorFlow, PyTorch
91
 
92
+ **Service link**: [http://64.110.84.104:7860](http://64.110.84.104:7860)
93
+ **Code link**: [https://huggingface.co/spaces/yunzi7/icebreaking/tree/main](https://huggingface.co/spaces/yunzi7/icebreaking/tree/main)
 
94
 
95
+ For more details about the model architecture, check out the [config.json](./config.json).
 
96