nazemi
commited on
Commit
·
93b0f77
1
Parent(s):
370b45f
End of training
Browse files- README.md +19 -19
- app.py +107 -0
- runs/Jun17_15-53-04_MacBook-Pro.local/events.out.tfevents.1718610786.MacBook-Pro.local +3 -0
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -15,7 +15,7 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 15 |
|
| 16 |
This model is a fine-tuned version of [t5-large](https://huggingface.co/t5-large) on an unknown dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
-
- Loss: 0.
|
| 19 |
|
| 20 |
## Model description
|
| 21 |
|
|
@@ -48,24 +48,24 @@ The following hyperparameters were used during training:
|
|
| 48 |
|:-------------:|:-----:|:----:|:---------------:|
|
| 49 |
| 5.0173 | 1.0 | 26 | 3.6634 |
|
| 50 |
| 1.3207 | 2.0 | 52 | 1.6421 |
|
| 51 |
-
| 1.
|
| 52 |
-
| 0.
|
| 53 |
-
|
|
| 54 |
-
| 0.
|
| 55 |
-
| 0.
|
| 56 |
-
| 0.
|
| 57 |
-
| 0.
|
| 58 |
-
| 0.
|
| 59 |
-
| 0.
|
| 60 |
-
| 0.
|
| 61 |
-
| 0.
|
| 62 |
-
| 0.
|
| 63 |
-
| 0.
|
| 64 |
-
| 0.
|
| 65 |
-
| 0.
|
| 66 |
-
| 0.
|
| 67 |
-
| 0.
|
| 68 |
-
| 0.
|
| 69 |
|
| 70 |
|
| 71 |
### Framework versions
|
|
|
|
| 15 |
|
| 16 |
This model is a fine-tuned version of [t5-large](https://huggingface.co/t5-large) on an unknown dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
+
- Loss: 0.0226
|
| 19 |
|
| 20 |
## Model description
|
| 21 |
|
|
|
|
| 48 |
|:-------------:|:-----:|:----:|:---------------:|
|
| 49 |
| 5.0173 | 1.0 | 26 | 3.6634 |
|
| 50 |
| 1.3207 | 2.0 | 52 | 1.6421 |
|
| 51 |
+
| 1.509 | 3.0 | 78 | 0.8581 |
|
| 52 |
+
| 0.5497 | 4.0 | 104 | 0.4255 |
|
| 53 |
+
| 1.03 | 5.0 | 130 | 0.2530 |
|
| 54 |
+
| 0.2971 | 6.0 | 156 | 0.1623 |
|
| 55 |
+
| 0.2127 | 7.0 | 182 | 0.1202 |
|
| 56 |
+
| 0.2528 | 8.0 | 208 | 0.0950 |
|
| 57 |
+
| 0.1327 | 9.0 | 234 | 0.0767 |
|
| 58 |
+
| 0.0153 | 10.0 | 260 | 0.0653 |
|
| 59 |
+
| 0.0677 | 11.0 | 286 | 0.0579 |
|
| 60 |
+
| 0.0441 | 12.0 | 312 | 0.0505 |
|
| 61 |
+
| 0.0254 | 13.0 | 338 | 0.0425 |
|
| 62 |
+
| 0.022 | 14.0 | 364 | 0.0325 |
|
| 63 |
+
| 0.0683 | 15.0 | 390 | 0.0277 |
|
| 64 |
+
| 0.0128 | 16.0 | 416 | 0.0265 |
|
| 65 |
+
| 0.1322 | 17.0 | 442 | 0.0251 |
|
| 66 |
+
| 0.2482 | 18.0 | 468 | 0.0237 |
|
| 67 |
+
| 0.003 | 19.0 | 494 | 0.0226 |
|
| 68 |
+
| 0.0118 | 20.0 | 520 | 0.0226 |
|
| 69 |
|
| 70 |
|
| 71 |
### Framework versions
|
app.py
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import json
|
| 3 |
+
import asyncio
|
| 4 |
+
import websockets
|
| 5 |
+
from transformers import pipeline
|
| 6 |
+
classifier1 = pipeline("text-classification", model="ja_gi_47")
|
| 7 |
+
#classifier2 = pipeline("text-classification", model="ja_gi_71")
|
| 8 |
+
extractor1 = pipeline("text2text-generation", model="name_extract")
|
| 9 |
+
extractor2 = pipeline("text2text-generation", model="postcode_extract")
|
| 10 |
+
extractor3 = pipeline("text2text-generation", model="time_extract")
|
| 11 |
+
extractor4 = pipeline("text2text-generation", model="task_extract")
|
| 12 |
+
extractor5 = pipeline("text2text-generation", model="occ_extract")
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
async def time_extractor(websocket, path):
|
| 16 |
+
try:
|
| 17 |
+
while True:
|
| 18 |
+
data = await websocket.recv()
|
| 19 |
+
payload = json.loads(data)
|
| 20 |
+
intent = payload["prompt"]
|
| 21 |
+
label=extractor3(intent)[0]["generated_text"]
|
| 22 |
+
#label= time_check(dt)
|
| 23 |
+
if label=="":
|
| 24 |
+
label="No time intent detected"
|
| 25 |
+
await websocket.send(json.dumps(label))
|
| 26 |
+
except websockets.ConnectionClosed:
|
| 27 |
+
print("Connection closed")
|
| 28 |
+
async def task_extractor(websocket, path):
|
| 29 |
+
try:
|
| 30 |
+
while True:
|
| 31 |
+
data = await websocket.recv()
|
| 32 |
+
payload = json.loads(data)
|
| 33 |
+
intent = payload["prompt"]
|
| 34 |
+
label=extractor4(intent)[0]["generated_text"]
|
| 35 |
+
if label=="":
|
| 36 |
+
label="No request detected"
|
| 37 |
+
await websocket.send(json.dumps(label))
|
| 38 |
+
except websockets.ConnectionClosed:
|
| 39 |
+
print("Connection closed")
|
| 40 |
+
async def postcode_extractor(websocket, path):
|
| 41 |
+
try:
|
| 42 |
+
while True:
|
| 43 |
+
data = await websocket.recv()
|
| 44 |
+
payload = json.loads(data)
|
| 45 |
+
intent = payload["prompt"]
|
| 46 |
+
label=extractor2(intent)[0]["generated_text"]
|
| 47 |
+
|
| 48 |
+
if label.count(" ")>2:
|
| 49 |
+
label=""
|
| 50 |
+
if label=="":
|
| 51 |
+
label="No postcode detected"
|
| 52 |
+
await websocket.send(json.dumps(label))
|
| 53 |
+
except websockets.ConnectionClosed:
|
| 54 |
+
print("Connection closed")
|
| 55 |
+
async def name_extractor(websocket, path):
|
| 56 |
+
try:
|
| 57 |
+
while True:
|
| 58 |
+
data = await websocket.recv()
|
| 59 |
+
payload = json.loads(data)
|
| 60 |
+
intent = payload["prompt"]
|
| 61 |
+
label=extractor1(intent)[0]["generated_text"]
|
| 62 |
+
await websocket.send(json.dumps(label))
|
| 63 |
+
except websockets.ConnectionClosed:
|
| 64 |
+
print("Connection closed")
|
| 65 |
+
async def occ_extractor(websocket, path):
|
| 66 |
+
try:
|
| 67 |
+
while True:
|
| 68 |
+
data = await websocket.recv()
|
| 69 |
+
payload = json.loads(data)
|
| 70 |
+
intent = payload["prompt"]
|
| 71 |
+
label=extractor5(intent)[0]["generated_text"]
|
| 72 |
+
if label=="":
|
| 73 |
+
label="No occupation detected"
|
| 74 |
+
await websocket.send(json.dumps(label))
|
| 75 |
+
except websockets.ConnectionClosed:
|
| 76 |
+
print("Connection closed")
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
async def classify_intent1(websocket, path):
|
| 80 |
+
try:
|
| 81 |
+
while True:
|
| 82 |
+
data = await websocket.recv()
|
| 83 |
+
payload = json.loads(data)
|
| 84 |
+
intent = payload["prompt"]
|
| 85 |
+
label=classifier1(intent)[0]["label"]
|
| 86 |
+
await websocket.send(json.dumps(label))
|
| 87 |
+
except websockets.ConnectionClosed:
|
| 88 |
+
print("Connection closed")
|
| 89 |
+
async def start_server():
|
| 90 |
+
server0 = await websockets.serve(name_extractor, "0.0.0.0",8764)
|
| 91 |
+
print("Server name started")
|
| 92 |
+
server1 = await websockets.serve(classify_intent1, "0.0.0.0",8765)
|
| 93 |
+
print("Server 47 started")
|
| 94 |
+
server2 = await websockets.serve(occ_extractor, "0.0.0.0", 8766)
|
| 95 |
+
print("Server 71 started")
|
| 96 |
+
server3 = await websockets.serve(postcode_extractor, "0.0.0.0", 8763)
|
| 97 |
+
print("Server postcode started")
|
| 98 |
+
server4 = await websockets.serve(time_extractor, "0.0.0.0", 8762)
|
| 99 |
+
print("Server time started")
|
| 100 |
+
server5 = await websockets.serve(task_extractor, "0.0.0.0", 8761)
|
| 101 |
+
print("Server task started")
|
| 102 |
+
|
| 103 |
+
await asyncio.Future()
|
| 104 |
+
|
| 105 |
+
asyncio.run(start_server())
|
| 106 |
+
# await server2.wait_closed()
|
| 107 |
+
|
runs/Jun17_15-53-04_MacBook-Pro.local/events.out.tfevents.1718610786.MacBook-Pro.local
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dfea339ffbcb69ea334da0ebf8f7cde11ac64efa4703e7836ed25222324ae1ac
|
| 3 |
+
size 120768
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5304
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:124d5b5fbae36b125f494e81eec17dd0e290c0d047f9559e71f30a51f4e8eaca
|
| 3 |
size 5304
|