Spaces:
Runtime error
Runtime error
JollypopChannel
commited on
Commit
•
b33571d
1
Parent(s):
c9f3392
Add CEFR ALL level option for the input, fix the append output file issue to overwrite instead
Browse files- 127.0.0.1.txt +249 -0
- __pycache__/model.cpython-310.pyc +0 -0
- app.py +6 -5
- model.py +6 -1
- templates/index.html +1 -0
127.0.0.1.txt
CHANGED
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__________ T2E Vocabulary Exam Generator __________
|
2 |
+
| Welcome to T2E Vocabulary Exam Generator! |
|
3 |
+
| We are glad that our service is useful to you. |
|
4 |
+
| |
|
5 |
+
| Copyrights 2023, Nutnornont Chamadol |
|
6 |
+
| Email: nontc49@gmail.com |
|
7 |
+
| Visit https://nontgcob.com to learn more |
|
8 |
+
| |
|
9 |
+
| Your exam is generated below. |
|
10 |
+
| - Happy using T2E Vocabulary Exam Generator! - |
|
11 |
+
|__________________________________________________|
|
12 |
+
|
13 |
+
What does the word "afterward" means in this sentence "Her Pepperup potion worked instantly"?
|
14 |
+
- happening at a time subsequent to a reference time
|
15 |
+
|
16 |
+
What does the word "arrive" means in this sentence "October [arrived]"?
|
17 |
+
- reach a destination; arrive by movement or progress
|
18 |
+
- succeed in a big way; get to the top
|
19 |
+
|
20 |
+
What does the word "busy" means in this sentence "Madam Pomfrey"?
|
21 |
+
- intrusive in a meddling or offensive manner
|
22 |
+
- actively or fully engaged or occupied
|
23 |
+
- keep busy with
|
24 |
+
- crowded with or characterized by much activity
|
25 |
+
- (of facilities such as telephones or lavatories) unavailable for use by anyone else or indicating unavailability; (`engaged' is a British term for a busy telephone line)
|
26 |
+
- overcrowded or cluttered with detail
|
27 |
+
|
28 |
+
What does the word "castle" means in this sentence "October arrived"?
|
29 |
+
- a large and stately mansion
|
30 |
+
- move the king two squares toward a rook and in the same move the rook to the square next past the king
|
31 |
+
- a large building formerly occupied by a ruler and fortified against attack
|
32 |
+
- (chess) the piece that can move any number of unoccupied squares in a direction parallel to the sides of the chessboard
|
33 |
+
- interchanging the positions of the king and a rook
|
34 |
+
|
35 |
+
What does the word "cold" means in this sentence "Madam Pomfrey"?
|
36 |
+
- a mild viral infection involving the nose and respiratory passages (but not the lungs)
|
37 |
+
- the sensation produced by low temperatures
|
38 |
+
- having a low or inadequate temperature or feeling a sensation of coldness or having been made cold by e.g. ice or refrigeration
|
39 |
+
- the absence of heat
|
40 |
+
- extended meanings; especially of psychological coldness; without human warmth or emotion
|
41 |
+
- (color) giving no sensation of warmth
|
42 |
+
- lacking originality or spontaneity; no longer new
|
43 |
+
- without compunction or human feeling
|
44 |
+
- of a seeker; far from the object sought
|
45 |
+
- so intense as to be almost uncontrollable
|
46 |
+
- feeling or showing no enthusiasm
|
47 |
+
- marked by errorless familiarity
|
48 |
+
- unconscious from a blow or shock or intoxication
|
49 |
+
- lacking the warmth of life
|
50 |
+
- having lost freshness through passage of time
|
51 |
+
- sexually unresponsive
|
52 |
+
|
53 |
+
What does the word "damp" means in this sentence "October arrived"?
|
54 |
+
- slightly wet
|
55 |
+
- lessen in force or effect
|
56 |
+
- a slight wetness
|
57 |
+
- make vague or obscure or make (an image) less visible
|
58 |
+
- restrain or discourage
|
59 |
+
- deaden (a sound or noise)
|
60 |
+
|
61 |
+
What does the word "ear" means in this sentence "Her Pepperup potion worked instantly"?
|
62 |
+
- good hearing
|
63 |
+
- the externally visible cartilaginous structure of the external ear
|
64 |
+
- the sense organ for hearing and equilibrium
|
65 |
+
- attention to what is said
|
66 |
+
- fruiting spike of a cereal plant especially corn
|
67 |
+
|
68 |
+
What does the word "ground" means in this sentence "October arrived"?
|
69 |
+
- hit a groundball
|
70 |
+
- hit or reach the ground
|
71 |
+
- hit onto the ground
|
72 |
+
- place or put on the ground
|
73 |
+
- bring to the ground
|
74 |
+
- the solid part of the earth's surface
|
75 |
+
- confine or restrict to the ground
|
76 |
+
- connect to a ground
|
77 |
+
- throw to the ground in order to stop play and avoid being tackled behind the line of scrimmage
|
78 |
+
- a relation that provides the foundation for something
|
79 |
+
- the loose soft material that makes up a large part of the land surface
|
80 |
+
- reduce to small pieces or particles by pounding or abrading
|
81 |
+
- use as a basis for; found on
|
82 |
+
- (art) the surface (as a wall or canvas) prepared to take the paint for a painting
|
83 |
+
- cover with a primer; apply a primer to
|
84 |
+
- fix firmly and stably
|
85 |
+
- work hard
|
86 |
+
- dance by rotating the pelvis in an erotically suggestive way
|
87 |
+
- a rational motive for a belief or action
|
88 |
+
- the first or preliminary coat of paint or size applied to a surface
|
89 |
+
- created by grinding
|
90 |
+
- instruct someone in the fundamentals of a subject
|
91 |
+
- material in the top layer of the surface of the earth in which plants can grow (especially with reference to its quality or use)
|
92 |
+
- press or grind with a crushing noise
|
93 |
+
- the part of a scene (or picture) that lies behind objects in the foreground
|
94 |
+
- make a grating or grinding sound by rubbing together
|
95 |
+
- a position to be won or defended in battle (or as if in battle)
|
96 |
+
- a relatively homogeneous percept extending back of the figure on which attention is focused
|
97 |
+
- shape or form by grinding
|
98 |
+
- a connection between an electrical device and a large conducting body
|
99 |
+
|
100 |
+
What does the word "hour" means in this sentence "Her Pepperup potion worked instantly"?
|
101 |
+
- a period of time equal to 1/24th of a day
|
102 |
+
- a special and memorable period
|
103 |
+
- distance measured by the time taken to cover it
|
104 |
+
- clock time
|
105 |
+
|
106 |
+
What does the word "instantly" means in this sentence "Her Pepperup potion worked [instantly]"?
|
107 |
+
- without any delay
|
108 |
+
- without delay or hesitation; with no time intervening
|
109 |
+
|
110 |
+
What does the word "keep" means in this sentence "Madam Pomfrey"?
|
111 |
+
- retain possession of
|
112 |
+
- maintain for use and service
|
113 |
+
- look after; be the keeper of; have charge of
|
114 |
+
- supply with necessities and support
|
115 |
+
- store or keep customarily
|
116 |
+
- stop (someone or something) from doing something or being in a certain state
|
117 |
+
- continue a certain state
|
118 |
+
- maintain in safety from injury
|
119 |
+
- maintain by writing regular records
|
120 |
+
- retain rights to
|
121 |
+
- keep under control; keep in check
|
122 |
+
- hold and prevent from leaving
|
123 |
+
- allow to remain in a place or position or maintain a property or feature
|
124 |
+
- keep in a certain state
|
125 |
+
- conform one's action or practice to
|
126 |
+
- prevent (food) from rotting
|
127 |
+
- stick to correctly or closely
|
128 |
+
- supply with room and board
|
129 |
+
- the financial means whereby one lives
|
130 |
+
- behave as expected during of holidays or rites
|
131 |
+
- raise
|
132 |
+
- a cell in a jail or prison
|
133 |
+
- fail to spoil or rot
|
134 |
+
- have as a supply
|
135 |
+
- the main tower within the walls of a medieval castle or fortress
|
136 |
+
|
137 |
+
What does the word "leave" means in this sentence "Her Pepperup potion worked instantly"?
|
138 |
+
- move out of or depart from
|
139 |
+
- have as a result or residue
|
140 |
+
- remove oneself from an association with or participation in
|
141 |
+
- go away from a place
|
142 |
+
- the period of time during which you are absent from work or duty
|
143 |
+
- act or be so as to become in a specified state
|
144 |
+
- put into the care or protection of someone
|
145 |
+
- leave or give by will after one's death
|
146 |
+
- leave behind unintentionally
|
147 |
+
- transmit (knowledge or skills)
|
148 |
+
- have left or have as a remainder
|
149 |
+
- go and leave behind
|
150 |
+
- leave unchanged or undisturbed or refrain from taking
|
151 |
+
- be survived by after one's death
|
152 |
+
- permission to do something
|
153 |
+
- make a possibility or provide opportunity for; permit to be attainable or cause to remain
|
154 |
+
- the act of departing politely
|
155 |
+
|
156 |
+
What does the word "nurse" means in this sentence "Madam Pomfrey"?
|
157 |
+
- serve as a nurse; care for sick or handicapped people
|
158 |
+
- maintain (a theory
|
159 |
+
- one skilled in caring for young children or the sick (usually under the supervision of a physician)
|
160 |
+
- a woman who is the custodian of children
|
161 |
+
- give suck to
|
162 |
+
- treat carefully
|
163 |
+
- try to cure by special care of treatment
|
164 |
+
|
165 |
+
What does the word "smoking" means in this sentence "Her Pepperup potion worked instantly"?
|
166 |
+
- inhale and exhale smoke from cigarettes
|
167 |
+
- the act of smoking tobacco or other substances
|
168 |
+
- emitting smoke in great volume
|
169 |
+
- a hot vapor containing fine particles of carbon being produced by combustion
|
170 |
+
- emit a cloud of fine particles
|
171 |
+
|
172 |
+
What does the word "spread" means in this sentence "October arrived"?
|
173 |
+
- become distributed or widespread
|
174 |
+
- distributed or spread over a considerable extent
|
175 |
+
- distribute or disperse widely
|
176 |
+
- cause to become widely known
|
177 |
+
- fully extended in width
|
178 |
+
- strew or distribute over an area
|
179 |
+
- spread out or open from a closed or folded state
|
180 |
+
- farm consisting of a large tract of land along with facilities needed to raise livestock (especially cattle)
|
181 |
+
- spread across or over
|
182 |
+
- act of extending over a wider scope or expanse of space or time
|
183 |
+
- distribute over a surface in a layer
|
184 |
+
- cover by spreading something over
|
185 |
+
- a haphazard distribution in all directions
|
186 |
+
- become widely known and passed on
|
187 |
+
- process or result of distributing or extending over a wide expanse of space
|
188 |
+
- move outward
|
189 |
+
- a tasty mixture to be spread on bread or crackers or used in preparing other dishes
|
190 |
+
- decorative cover for a bed
|
191 |
+
- two facing pages of a book or other publication
|
192 |
+
- prepared or arranged for a meal; especially having food set out
|
193 |
+
- the expansion of a person's girth (especially at middle age)
|
194 |
+
- a meal that is well prepared and greatly enjoyed
|
195 |
+
- a conspicuous disparity or difference as between two figures
|
196 |
+
|
197 |
+
What does the word "staff" means in this sentence "Madam Pomfrey"?
|
198 |
+
- provide with staff
|
199 |
+
- serve on the staff of
|
200 |
+
- personnel who assist their superior in carrying out an assigned task
|
201 |
+
- the body of teachers and administrators at a school
|
202 |
+
- building material consisting of plaster and hair; used to cover external surfaces of temporary structure (as at an exposition) or for decoration
|
203 |
+
- (music) the system of five horizontal lines on which the musical notes are written
|
204 |
+
- a rod carried as a symbol
|
205 |
+
- a strong rod or stick with a specialized utilitarian purpose
|
206 |
+
|
207 |
+
What does the word "student" means in this sentence "Madam Pomfrey"?
|
208 |
+
- a learner who is enrolled in an educational institution
|
209 |
+
- a learned person (especially in the humanities); someone who by long study has gained mastery in one or more disciplines
|
210 |
+
|
211 |
+
What does the word "sudden" means in this sentence "Madam Pomfrey"?
|
212 |
+
- happening without warning or in a short space of time
|
213 |
+
|
214 |
+
What does the word "work" means in this sentence "Her Pepperup potion [worked] instantly"?
|
215 |
+
- have and exert influence or effect
|
216 |
+
- exert oneself by doing mental or physical work for a purpose or out of necessity
|
217 |
+
- activity directed toward making or doing something
|
218 |
+
- be employed
|
219 |
+
- cause to work
|
220 |
+
- give a workout to
|
221 |
+
- make something
|
222 |
+
- a product produced or accomplished through the effort or activity or agency of a person or thing
|
223 |
+
- perform as expected when applied
|
224 |
+
- the occupation for which you are paid
|
225 |
+
- arrive at a certain condition through repeated motion
|
226 |
+
- cause to operate or function
|
227 |
+
- cause to happen or to occur as a consequence
|
228 |
+
- (physics) a manifestation of energy; the transfer of energy from one physical system to another expressed as the product of a force and the distance through which it moves a body in the direction of that force
|
229 |
+
- operate in or through
|
230 |
+
- provoke or excite
|
231 |
+
- have an effect or outcome; often the one desired or expected
|
232 |
+
- the total output of a writer or artist (or a substantial part of it)
|
233 |
+
- shape
|
234 |
+
- operate in a certain place
|
235 |
+
- gratify and charm
|
236 |
+
- a place where work is done
|
237 |
+
- applying the mind to learning and understanding a subject (especially by reading)
|
238 |
+
- go sour or spoil
|
239 |
+
- cause to undergo fermentation
|
240 |
+
- use or manipulate to one's advantage
|
241 |
+
- make uniform
|
242 |
+
- move in an agitated manner
|
243 |
+
- move into or onto
|
244 |
+
- prepare for crops
|
245 |
+
- behave in a certain way when handled
|
246 |
+
- proceed towards a goal or along a path or through an activity
|
247 |
+
- find the solution to (a problem or question) or understand the meaning of
|
248 |
+
- proceed along a path
|
249 |
+
|
__pycache__/model.cpython-310.pyc
CHANGED
Binary files a/__pycache__/model.cpython-310.pyc and b/__pycache__/model.cpython-310.pyc differ
|
|
app.py
CHANGED
@@ -7,8 +7,8 @@ app = Flask(__name__)
|
|
7 |
@app.route('/')
|
8 |
def index():
|
9 |
T2E_exam = str(request.remote_addr) + ".txt"
|
10 |
-
with open(T2E_exam, "w") as file:
|
11 |
-
|
12 |
return render_template('index.html')
|
13 |
|
14 |
@app.route('/process', methods=['POST'])
|
@@ -24,7 +24,7 @@ def process():
|
|
24 |
count = 0
|
25 |
max_choice = 4
|
26 |
|
27 |
-
with open(T2E_exam, "
|
28 |
file.write("__________ T2E Vocabulary Exam Generator __________\n")
|
29 |
file.write("| Welcome to T2E Vocabulary Exam Generator! |\n")
|
30 |
file.write("| We are glad that our service is useful to you. |\n")
|
@@ -45,7 +45,8 @@ def process():
|
|
45 |
file.write(f'What does the word "{vvocab}" means in this sentence "{sentence}"?\n')
|
46 |
|
47 |
for choice in value:
|
48 |
-
|
|
|
49 |
# print(f"- {choice}")
|
50 |
with open(T2E_exam, "a") as file:
|
51 |
file.write(f"- {choice}\n")
|
@@ -57,7 +58,7 @@ def process():
|
|
57 |
|
58 |
return render_template('result.html', output="Exam successfully generated!", file_path="T2E_exam.txt")
|
59 |
|
60 |
-
from flask import send_file
|
61 |
|
62 |
@app.route('/send')
|
63 |
def get_file():
|
|
|
7 |
@app.route('/')
|
8 |
def index():
|
9 |
T2E_exam = str(request.remote_addr) + ".txt"
|
10 |
+
# with open(T2E_exam, "w") as file:
|
11 |
+
# file.write("")
|
12 |
return render_template('index.html')
|
13 |
|
14 |
@app.route('/process', methods=['POST'])
|
|
|
24 |
count = 0
|
25 |
max_choice = 4
|
26 |
|
27 |
+
with open(T2E_exam, "w") as file:
|
28 |
file.write("__________ T2E Vocabulary Exam Generator __________\n")
|
29 |
file.write("| Welcome to T2E Vocabulary Exam Generator! |\n")
|
30 |
file.write("| We are glad that our service is useful to you. |\n")
|
|
|
45 |
file.write(f'What does the word "{vvocab}" means in this sentence "{sentence}"?\n')
|
46 |
|
47 |
for choice in value:
|
48 |
+
choice = choice.split(", ")
|
49 |
+
choice = choice[1]
|
50 |
# print(f"- {choice}")
|
51 |
with open(T2E_exam, "a") as file:
|
52 |
file.write(f"- {choice}\n")
|
|
|
58 |
|
59 |
return render_template('result.html', output="Exam successfully generated!", file_path="T2E_exam.txt")
|
60 |
|
61 |
+
from flask import send_file, render_template
|
62 |
|
63 |
@app.route('/send')
|
64 |
def get_file():
|
model.py
CHANGED
@@ -16,6 +16,8 @@ import spacy
|
|
16 |
# Part Of Speech tagging (POS tagging)
|
17 |
nlp = spacy.load("en_core_web_sm")
|
18 |
|
|
|
|
|
19 |
|
20 |
def model(passage, level):
|
21 |
# pip install spacy
|
@@ -105,8 +107,11 @@ def model(passage, level):
|
|
105 |
# Filter in just the vocab that has the selected CEFR level that the user provided at the beginning
|
106 |
filtered0 = {}
|
107 |
for key, value in ready2filter.items():
|
108 |
-
if
|
109 |
filtered0[key] = value
|
|
|
|
|
|
|
110 |
|
111 |
# Rearrange the Python dictionary structure
|
112 |
filtered = {}
|
|
|
16 |
# Part Of Speech tagging (POS tagging)
|
17 |
nlp = spacy.load("en_core_web_sm")
|
18 |
|
19 |
+
print('successfully download model')
|
20 |
+
|
21 |
|
22 |
def model(passage, level):
|
23 |
# pip install spacy
|
|
|
107 |
# Filter in just the vocab that has the selected CEFR level that the user provided at the beginning
|
108 |
filtered0 = {}
|
109 |
for key, value in ready2filter.items():
|
110 |
+
if cefr_level == "ALL":
|
111 |
filtered0[key] = value
|
112 |
+
else:
|
113 |
+
if value == cefr_level:
|
114 |
+
filtered0[key] = value
|
115 |
|
116 |
# Rearrange the Python dictionary structure
|
117 |
filtered = {}
|
templates/index.html
CHANGED
@@ -128,6 +128,7 @@
|
|
128 |
<br>
|
129 |
<label for="cefr_level" class="level">Select CEFR level :</label>
|
130 |
<select name="cefr_level" id="cefr_level" class="cefr">
|
|
|
131 |
<option value="A1">A1</option>
|
132 |
<option value="A2">A2</option>
|
133 |
<option value="B1">B1</option>
|
|
|
128 |
<br>
|
129 |
<label for="cefr_level" class="level">Select CEFR level :</label>
|
130 |
<select name="cefr_level" id="cefr_level" class="cefr">
|
131 |
+
<option value="ALL">ALL</option>
|
132 |
<option value="A1">A1</option>
|
133 |
<option value="A2">A2</option>
|
134 |
<option value="B1">B1</option>
|