Spaces:
Sleeping
Sleeping
dbleek
commited on
Commit
•
f6cbd2d
1
Parent(s):
89f785e
linked to classifier
Browse files- .gitattributes +34 -34
- milestone-3.py +1 -6
.gitattributes
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
milestone-3.py
CHANGED
@@ -21,22 +21,17 @@ filtered_dataset = dataset_dict['validation'].filter(lambda e: e['decision'] ==
|
|
21 |
dataset = filtered_dataset.shuffle(seed=42).select(range(20))
|
22 |
dataset = dataset.sort("patent_number")
|
23 |
|
24 |
-
|
25 |
# Create pipeline using model trainned on Colab
|
26 |
-
model = torch.load("/workspaces/cs-gy-6613-project/
|
27 |
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
|
28 |
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
29 |
|
30 |
-
|
31 |
-
|
32 |
def load_patent():
|
33 |
selected_application = dataset.select([applications[st.session_state.id]])
|
34 |
st.session_state.abstract = selected_application['abstract'][0]
|
35 |
st.session_state.claims = selected_application['claims'][0]
|
36 |
st.session_state.title = selected_application['title'][0]
|
37 |
|
38 |
-
|
39 |
-
|
40 |
st.title("CS-GY-6613 Project Milestone 3")
|
41 |
|
42 |
# List patent numbers for select box
|
|
|
21 |
dataset = filtered_dataset.shuffle(seed=42).select(range(20))
|
22 |
dataset = dataset.sort("patent_number")
|
23 |
|
|
|
24 |
# Create pipeline using model trainned on Colab
|
25 |
+
model = torch.load("/workspaces/cs-gy-6613-project/patent_classifier.pt", map_location=torch.device('cpu'))
|
26 |
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
|
27 |
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
28 |
|
|
|
|
|
29 |
def load_patent():
|
30 |
selected_application = dataset.select([applications[st.session_state.id]])
|
31 |
st.session_state.abstract = selected_application['abstract'][0]
|
32 |
st.session_state.claims = selected_application['claims'][0]
|
33 |
st.session_state.title = selected_application['title'][0]
|
34 |
|
|
|
|
|
35 |
st.title("CS-GY-6613 Project Milestone 3")
|
36 |
|
37 |
# List patent numbers for select box
|