kevintu commited on
Commit
ae30fe3
·
verified ·
1 Parent(s): 392ee6b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +54 -34
README.md CHANGED
@@ -42,17 +42,24 @@ with torch.no_grad():
42
  predictions = outputs.logits.squeeze()
43
 
44
  predicted_scores = predictions.numpy()
45
- item_names = ["cohesion", "syntax", "vocabulary", "phraseology", "grammar", "conventions"]
46
- for item, score in zip(item_names, predicted_scores):
47
- print(f"{item}: {score:.4f}")
48
-
49
- ##"output" (values raning from 1 to 5):
50
- #cohesion: 3.5399
51
- #syntax: 3.6380
52
- #vocabulary: 3.9250
53
- #phraseology: 3.8381
54
- #grammar: 3.9194
55
- #conventions: 3.6819
 
 
 
 
 
 
 
56
 
57
  ```
58
 
@@ -76,18 +83,20 @@ predictions = outputs.logits.squeeze()
76
  predicted_scores = predictions.numpy() # Convert to numpy array
77
  item_names = ["cohesion", "syntax", "vocabulary", "phraseology", "grammar", "conventions"]
78
 
79
- # Scale predictions from 1 to 10
80
  scaled_scores = 2.25 * predicted_scores - 1.25
81
- for item, score in zip(item_names, scaled_scores):
82
- print(f"{trait}: {score:.4f}")
83
 
84
- ##"ouput" (values between 1-10)
85
- #cohesion: 6.7147
86
- #syntax: 6.9354
87
- #vocabulary: 7.5814
88
- #phraseology: 7.3856
89
- #grammar: 7.5687
90
- #conventions: 7.0344
 
 
 
91
 
92
  ```
93
 
@@ -98,24 +107,35 @@ Examples:
98
 
99
  new_text ="Dear Mauro, Thank you for agreeing to take a care of my house and my pets in my absence. This is my daily routine. Every day I water the plants, I walk the my dog in the morning and in the evening. I feed food it twice a day, I check water's dog twice a week. I take out trash every Friday. I sweep the floor and clean house on Monday and on Wednesday. In your free time you can watch TV and play video games. In the fridge I left coca cola and ice-cream for you Have a nice week. "
100
  ##ouput
101
- cohesion: 5.0837
102
- syntax: 4.9995
103
- vocabulary: 5.4083
104
- phraseology: 5.1587
105
- grammar: 4.9063
106
- conventions: 5.6578
107
 
108
 
109
  # the second example (C1 level)
110
 
111
  new_text = " Dear Mr. Tromps It was so good to hear from you and your group of international buyers are visiting our company next month. And in response to your question, I would like to recommend some suggestions about business etiquette in my country. Firstly, you'll need to make hotel's reservations with anticipation, especially when the group is numerous. There are several five starts hotels in the commercial center of the Guayaquil city, very close to our offices. Business appointments well in advance and don't be late. Usually, at those meetings the persons exchange presentation cards. Some places include tipping by services in restaurant bills, but if any not the tip is 10% of the bill. The people is very kind here, surely you'll be invited to a meal at a house, you can take a small gift as flowers, candy or wine. Finally, remember it's a beautiful summer here, especially in our city is always warm, then you might include appropriate clothes for this weather. If you have any questions, please just let me know. Have you a nice and safe trip. Sincerely, JG Marketing Dpt. LP Representations."
112
  ##output:
113
- cohesion: 8.0674
114
- syntax: 7.9963
115
- vocabulary: 8.0226
116
- phraseology: 8.1645
117
- grammar: 8.3697
118
- conventions: 8.2797
 
 
 
119
 
 
120
 
121
- ```
 
 
 
 
 
 
 
 
42
  predictions = outputs.logits.squeeze()
43
 
44
  predicted_scores = predictions.numpy()
45
+ item_names = ["cohesion", "syntax", "vocabulary", "phraseology", "grammar", "conventions"]
46
+
47
+ # Scale predictions from the raw output to the range [1, 5]
48
+ scaled_scores = 1 + 4 * (predicted_scores - np.min(predicted_scores)) / (np.max(predicted_scores) - np.min(predicted_scores))
49
+
50
+ # Round scores to the nearest 0.5
51
+ rounded_scores = np.round(scaled_scores * 2) / 2
52
+
53
+ for item, score in zip(item_names, rounded_scores):
54
+ print(f"{item}: {score:.1f}")
55
+
56
+ # Example output:
57
+ # cohesion: 3.5
58
+ # syntax: 3.5
59
+ # vocabulary: 4.0
60
+ # phraseology: 4.0
61
+ # grammar: 4.0
62
+ # conventions: 3.5
63
 
64
  ```
65
 
 
83
  predicted_scores = predictions.numpy() # Convert to numpy array
84
  item_names = ["cohesion", "syntax", "vocabulary", "phraseology", "grammar", "conventions"]
85
 
86
+ # Scale predictions from 1 to 10 and round to the nearest 0.5
87
  scaled_scores = 2.25 * predicted_scores - 1.25
88
+ rounded_scores = [round(score * 2) / 2 for score in scaled_scores] # Round to nearest 0.5
 
89
 
90
+ for item, score in zip(item_names, rounded_scores):
91
+ print(f"{item}: {score:.1f}")
92
+
93
+ # Example output:
94
+ # cohesion: 6.5
95
+ # syntax: 7.0
96
+ # vocabulary: 7.5
97
+ # phraseology: 7.5
98
+ # grammar: 7.5
99
+ # conventions: 7.0
100
 
101
  ```
102
 
 
107
 
108
  new_text ="Dear Mauro, Thank you for agreeing to take a care of my house and my pets in my absence. This is my daily routine. Every day I water the plants, I walk the my dog in the morning and in the evening. I feed food it twice a day, I check water's dog twice a week. I take out trash every Friday. I sweep the floor and clean house on Monday and on Wednesday. In your free time you can watch TV and play video games. In the fridge I left coca cola and ice-cream for you Have a nice week. "
109
  ##ouput
110
+ cohesion: 5.0
111
+ syntax: 5.0
112
+ vocabulary: 5.5
113
+ phraseology: 5.0
114
+ grammar: 5.0
115
+ conventions: 6.0
116
 
117
 
118
  # the second example (C1 level)
119
 
120
  new_text = " Dear Mr. Tromps It was so good to hear from you and your group of international buyers are visiting our company next month. And in response to your question, I would like to recommend some suggestions about business etiquette in my country. Firstly, you'll need to make hotel's reservations with anticipation, especially when the group is numerous. There are several five starts hotels in the commercial center of the Guayaquil city, very close to our offices. Business appointments well in advance and don't be late. Usually, at those meetings the persons exchange presentation cards. Some places include tipping by services in restaurant bills, but if any not the tip is 10% of the bill. The people is very kind here, surely you'll be invited to a meal at a house, you can take a small gift as flowers, candy or wine. Finally, remember it's a beautiful summer here, especially in our city is always warm, then you might include appropriate clothes for this weather. If you have any questions, please just let me know. Have you a nice and safe trip. Sincerely, JG Marketing Dpt. LP Representations."
121
  ##output:
122
+ cohesion: 8.0
123
+ syntax: 8.0
124
+ vocabulary: 8.0
125
+ phraseology: 8.5
126
+ grammar: 8.5
127
+ conventions: 8.5
128
+
129
+
130
+ ```
131
 
132
+ Please cite the following paper if you use this model:
133
 
134
+ @article{sun2024automatic,
135
+ title={Automatic Essay Multi-dimensional Scoring with Fine-tuning and Multiple Regression},
136
+ author={Kun Sun and Rong Wang},
137
+ year={2024},
138
+ journal={ArXiv},
139
+ url={https://arxiv.org/abs/5634515}
140
+ }
141
+