Spaces:
Sleeping
Sleeping
Commit
Β·
cf5b520
1
Parent(s):
442a3b7
fix: π ε€ζ ηΎεζε€εη±»
Browse files- Prediction.py +6 -8
- app.py +34 -37
- assets/csv_examples.csv +0 -30
- assets/example.csv +15 -0
- assets/examples.txt +14 -14
- convert.py +4 -2
- models/All_Data/config.json +4 -2
- models/All_Data/pytorch_model.bin +2 -2
- models/Facebook/config.json +0 -37
- models/Facebook/pytorch_model.bin +0 -3
- models/Facebook/vocab.txt +0 -0
- models/Kickstarter/config.json +0 -37
- models/Kickstarter/pytorch_model.bin +0 -3
- models/Kickstarter/vocab.txt +0 -0
- models/Twitter/config.json +0 -37
- models/Twitter/pytorch_model.bin +0 -3
- models/Twitter/vocab.txt +0 -0
- tmp.py +5 -0
Prediction.py
CHANGED
@@ -8,7 +8,7 @@ import glob
|
|
8 |
|
9 |
RANDOM_SEED = 42
|
10 |
pd.RANDOM_SEED = 42
|
11 |
-
LABEL_COLUMNS = ["Assertive Tone", "Conversational Tone", "Emotional Tone", "Informative Tone"]
|
12 |
|
13 |
|
14 |
@torch.no_grad()
|
@@ -34,16 +34,14 @@ def predict_csv(data, text_col, tokenizer, model, device, text_bs=16, max_token_
|
|
34 |
encoding["attention_mask"].to(device),
|
35 |
return_dict=True
|
36 |
).logits
|
37 |
-
prediction = torch.
|
38 |
predictions.append(prediction.detach().cpu())
|
39 |
|
40 |
final_pred = torch.cat(predictions, dim=0)
|
41 |
y_inten = final_pred.numpy().T
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
data[LABEL_COLUMNS[2]] = y_inten[2].tolist()
|
46 |
-
data[LABEL_COLUMNS[3]] = y_inten[3].tolist()
|
47 |
return data
|
48 |
|
49 |
@torch.no_grad()
|
@@ -63,7 +61,7 @@ def predict_single(sentence, tokenizer, model, device, max_token_len=128):
|
|
63 |
encoding["attention_mask"].to(device),
|
64 |
return_dict=True
|
65 |
).logits
|
66 |
-
prediction = torch.
|
67 |
y_inten = prediction.flatten().cpu().numpy().T.tolist()
|
68 |
return y_inten
|
69 |
|
@@ -84,7 +82,7 @@ def model_factory(local_path, device):
|
|
84 |
|
85 |
if __name__ == "__main__":
|
86 |
|
87 |
-
Data = pd.read_csv("Kickstarter_sentence_level_5000.csv")
|
88 |
Data = Data[:20]
|
89 |
device = torch.device('cpu')
|
90 |
|
|
|
8 |
|
9 |
RANDOM_SEED = 42
|
10 |
pd.RANDOM_SEED = 42
|
11 |
+
LABEL_COLUMNS = ["Assertive Tone", "Conversational Tone", "Emotional Tone", "Informative Tone", "None"]
|
12 |
|
13 |
|
14 |
@torch.no_grad()
|
|
|
34 |
encoding["attention_mask"].to(device),
|
35 |
return_dict=True
|
36 |
).logits
|
37 |
+
prediction = torch.softmax(logits, dim=1)
|
38 |
predictions.append(prediction.detach().cpu())
|
39 |
|
40 |
final_pred = torch.cat(predictions, dim=0)
|
41 |
y_inten = final_pred.numpy().T
|
42 |
|
43 |
+
for i in range(len(LABEL_COLUMNS)):
|
44 |
+
data[LABEL_COLUMNS[i]] = y_inten[i].tolist()
|
|
|
|
|
45 |
return data
|
46 |
|
47 |
@torch.no_grad()
|
|
|
61 |
encoding["attention_mask"].to(device),
|
62 |
return_dict=True
|
63 |
).logits
|
64 |
+
prediction = torch.softmax(logits, dim=1)
|
65 |
y_inten = prediction.flatten().cpu().numpy().T.tolist()
|
66 |
return y_inten
|
67 |
|
|
|
82 |
|
83 |
if __name__ == "__main__":
|
84 |
|
85 |
+
Data = pd.read_csv("assets/Kickstarter_sentence_level_5000.csv")
|
86 |
Data = Data[:20]
|
87 |
device = torch.device('cpu')
|
88 |
|
app.py
CHANGED
@@ -23,34 +23,34 @@ device = torch.device('cpu')
|
|
23 |
manager = model_factory("./models", device)
|
24 |
|
25 |
|
26 |
-
def single_sentence(sentence
|
27 |
df = []
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
return df
|
34 |
|
35 |
-
def csv_process(csv_file,
|
36 |
current_time = datetime.now()
|
37 |
formatted_time = current_time.strftime("%Y_%m_%d_%H_%M_%S")
|
38 |
-
|
|
|
39 |
os.makedirs('output', exist_ok=True)
|
40 |
outputs = []
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
outputs.append(output_path)
|
49 |
return outputs
|
50 |
|
51 |
|
52 |
my_theme = gr.Theme.from_hub("JohnSmith9982/small_and_pretty")
|
53 |
-
with gr.Blocks(theme=my_theme, title='
|
54 |
gr.HTML(
|
55 |
"""
|
56 |
<div style="display: flex; justify-content: center; align-items: center; text-align: center;">
|
@@ -72,24 +72,23 @@ with gr.Blocks(theme=my_theme, title='XXX') as demo:
|
|
72 |
with gr.Row():
|
73 |
tbox_input = gr.Textbox(label="Input",
|
74 |
info="Please input a sentence here:")
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
78 |
tab_output = gr.DataFrame(label='Probability Predictions:',
|
79 |
-
headers=
|
80 |
-
datatype=["str"] * (len(LABEL_COLUMNS)
|
81 |
-
interactive=False
|
82 |
-
wrap=True)
|
83 |
with gr.Row():
|
84 |
button_ss = gr.Button("Submit", variant="primary")
|
85 |
-
button_ss.click(fn=single_sentence, inputs=[tbox_input
|
86 |
gr.ClearButton([tbox_input, tab_output])
|
87 |
|
88 |
-
gr.Markdown("## Examples")
|
89 |
gr.Examples(
|
90 |
examples=examples,
|
91 |
inputs=tbox_input,
|
92 |
-
examples_per_page=
|
93 |
)
|
94 |
|
95 |
with gr.Tab("Csv File"):
|
@@ -100,20 +99,18 @@ with gr.Blocks(theme=my_theme, title='XXX') as demo:
|
|
100 |
)
|
101 |
csv_output = gr.File(label="Predictions:")
|
102 |
|
103 |
-
model_select = gr.CheckboxGroup(manager.keys(),
|
104 |
-
label="Models:",
|
105 |
-
info="Selecting different model variants to obtain aggregated predictions.")
|
106 |
-
|
107 |
with gr.Row():
|
108 |
button = gr.Button("Submit", variant="primary")
|
109 |
-
button.click(fn=csv_process, inputs=[csv_input
|
110 |
gr.ClearButton([csv_input, csv_output])
|
111 |
|
112 |
-
gr.Markdown("## Examples")
|
113 |
-
gr.
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
|
|
117 |
|
118 |
with gr.Tab("Readme"):
|
119 |
gr.Markdown(
|
|
|
23 |
manager = model_factory("./models", device)
|
24 |
|
25 |
|
26 |
+
def single_sentence(sentence):
|
27 |
df = []
|
28 |
+
model_name = 'All_Data'
|
29 |
+
dct = manager[model_name]
|
30 |
+
model, tokenizer = dct['model'], dct['tokenizer']
|
31 |
+
predictions = predict_single(sentence, tokenizer, model, device)
|
32 |
+
df.append([model_name] + predictions)
|
33 |
return df
|
34 |
|
35 |
+
def csv_process(csv_file, attr="content"):
|
36 |
current_time = datetime.now()
|
37 |
formatted_time = current_time.strftime("%Y_%m_%d_%H_%M_%S")
|
38 |
+
data = pd.read_csv(csv_file.name)
|
39 |
+
data = data.reset_index()
|
40 |
os.makedirs('output', exist_ok=True)
|
41 |
outputs = []
|
42 |
+
model_name = 'All_Data'
|
43 |
+
dct = manager[model_name]
|
44 |
+
model, tokenizer = dct['model'], dct['tokenizer']
|
45 |
+
predictions = predict_csv(data, attr, tokenizer, model, device)
|
46 |
+
output_path = f"output/prediction_{model_name}_{formatted_time}.csv"
|
47 |
+
predictions.to_csv(output_path)
|
48 |
+
outputs.append(output_path)
|
|
|
49 |
return outputs
|
50 |
|
51 |
|
52 |
my_theme = gr.Theme.from_hub("JohnSmith9982/small_and_pretty")
|
53 |
+
with gr.Blocks(theme=my_theme, title='Murphy') as demo:
|
54 |
gr.HTML(
|
55 |
"""
|
56 |
<div style="display: flex; justify-content: center; align-items: center; text-align: center;">
|
|
|
72 |
with gr.Row():
|
73 |
tbox_input = gr.Textbox(label="Input",
|
74 |
info="Please input a sentence here:")
|
75 |
+
gr.Markdown("""
|
76 |
+
# Detailed Information About our Model
|
77 |
+
...
|
78 |
+
""")
|
79 |
tab_output = gr.DataFrame(label='Probability Predictions:',
|
80 |
+
headers=LABEL_COLUMNS,
|
81 |
+
datatype=["str"] * (len(LABEL_COLUMNS)),
|
82 |
+
interactive=False)
|
|
|
83 |
with gr.Row():
|
84 |
button_ss = gr.Button("Submit", variant="primary")
|
85 |
+
button_ss.click(fn=single_sentence, inputs=[tbox_input], outputs=[tab_output])
|
86 |
gr.ClearButton([tbox_input, tab_output])
|
87 |
|
|
|
88 |
gr.Examples(
|
89 |
examples=examples,
|
90 |
inputs=tbox_input,
|
91 |
+
examples_per_page=len(examples)
|
92 |
)
|
93 |
|
94 |
with gr.Tab("Csv File"):
|
|
|
99 |
)
|
100 |
csv_output = gr.File(label="Predictions:")
|
101 |
|
|
|
|
|
|
|
|
|
102 |
with gr.Row():
|
103 |
button = gr.Button("Submit", variant="primary")
|
104 |
+
button.click(fn=csv_process, inputs=[csv_input], outputs=[csv_output])
|
105 |
gr.ClearButton([csv_input, csv_output])
|
106 |
|
107 |
+
gr.Markdown("## Examples \n The incoming CSV must include the ``content`` field, which represents the text that needs to be predicted!")
|
108 |
+
gr.DataFrame(label='Csv input format:',
|
109 |
+
value=[[i, examples[i]] for i in range(len(examples))],
|
110 |
+
headers=["index", "content"],
|
111 |
+
datatype=["number","str"],
|
112 |
+
interactive=False
|
113 |
+
)
|
114 |
|
115 |
with gr.Tab("Readme"):
|
116 |
gr.Markdown(
|
assets/csv_examples.csv
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
,index,content,word_count
|
2 |
-
0,225644,The first prototype did not clip together well and had strength issues so we redesigned it with new sides and a different tabs structure.,24
|
3 |
-
1,989071,Maybe you own a shop or perhaps you and your friends want to go in on this together to save some money.,22
|
4 |
-
2,332310,"With this campaign we want to propose ""Eternity Dice Regular and Charms Edition"", sculpted by hand in stone, with a polished finish and highly accurate details.",26
|
5 |
-
3,101474,"It's hand cut from a thick and reliable high quality calf skin, which is soft and flexible enough for wearing with utmost comfort.",23
|
6 |
-
4,1641986,"a# by 5 WHAT SEPARATES US FROM THE COMPETITION a lax-ll 360 AUDIO FLOATABLE Full submergable up to Superior surround sound Counter balanced for optimal 1 meter for 30 minutes audio direction while floating WIRELESS SPECIFICATIONS MATERIALS sarr of whreless Small and compact, with Engineered to perfection streaming range enormous sound with the highest quality materials avalable PRICE-POINT WARRANTY BVURABILITY Affordable technology Cone yearlimited warranty | Rubberized shock absorbing cover PATENTS BUILT-IN MIC BATTERY LIFE Patent.Pending stabalization .",78
|
7 |
-
5,1632938,Much of the known world is either from this culture or has converted to the faith.,16
|
8 |
-
6,1141502,"The more I play it, the more I want to play it.",12
|
9 |
-
7,1424712,"There are weapons all around you, you just never thought about your household goods that way.",16
|
10 |
-
8,460625,"In September, I'm going down to Virginia with a bunch of my music buddies to record the album.",18
|
11 |
-
9,179267,"It is suitable for use with Cthulhu, Horror, Space and Dungeon - style miniature games.",15
|
12 |
-
10,1092530,Games of the imagination teach us actions have consequences in a realm that can be reset.,16
|
13 |
-
11,1050585,"Intense cleaning of the existing space, brick repairs, and removal of unneeded materials is also necessary.",16
|
14 |
-
12,1126342,These will include color artwork and fully designed stats to help you build exciting and unique Shadowlands encounters.,18
|
15 |
-
13,277427,"If you're leaving the backpack unattended, the bag itself can be secured to almost any fixed object using the integrated steel wire and combination lock, making it impossible for opportunistic thieves to access your belongings or steal the bag, without special cutting equipment.",43
|
16 |
-
14,307425,Their parents had recruited the police and even had the church issuing official statements forbidding the girls to walk through monastery doors.,22
|
17 |
-
15,611566,is a childrenΓ’ΒΒs book for elementary school age kids with illustrations appealing to people of all ages.,17
|
18 |
-
16,951173,"Thanks to you we reached our original goal, so we got festival fees and insurance covered.",16
|
19 |
-
17,1294624,"ΓΒ It's been really well-received, and recently won an online award for Best New Tabletop Sports Game of 2013.",19
|
20 |
-
18,686912,"But New Jersey farmers are retiring and all over the state, development continues to push out dwindling farmland.",18
|
21 |
-
19,1291430,"Support Cards for easily setting initiative and keeping track of hit points, ammo, etc, speeding things up and eliminating the need for any writing/erasing Deep character creation with options designed for interesting roleplaying, and super fast to create (5 minutes or less) Specially laminated Character Cards take the place of the old character sheet, making information extremely easy to find and removing clutter from the gaming table Easily expandable without having to purchase and read through lengthy new books - newΓΒ equipment, weapons, powers, skills, and opponents can be instantly added to your game with Setting Cards All special rules for equipment, weapons, powers, skills, and opponents printed on cards kept in player hands, so you never have to go searching for them Completely genre neutral, so assets from any setting are completely compatible with any others, making your game infinitely expandable and customizable Tech-themed Resolution Deck Concept Built from the ground up with VTTs (Virtual Table Tops) in mind, with all digital assets ready to drop into your game to integrate seamlessly with groups who play remotely Complete playable module with starter adventure included in backer rewards of $10 or more!",192
|
22 |
-
20,1656635,"Their bond of friendship makes the journey more important than the destination as they share their dreams, frustrations and fears.ΓΒ The story goes on to show the dramatic impact this innocent childhood adventure has on their young adult lives.",39
|
23 |
-
21,1679298,"He also is the Head Designer of The Design Trust so-to-speak, besides his regular job ...",16
|
24 |
-
22,337389,"This year, the film team has plans to produce a short comedy, based on a true story set in the city of Jerusalem.",23
|
25 |
-
23,980529,"$12,000 - Roguelike Player Mat This player mat will include extra rules to play Baldrick's Tomb as a solo player Roguelike.",21
|
26 |
-
24,1700094,_ Thank you for viewing the project!,7
|
27 |
-
25,420192,We appreciate your support and thank you for joining us in helping cause this mission stay in action.,18
|
28 |
-
26,1469419,It'll even be foil-wrapped like baseball cards!,7
|
29 |
-
27,105008,We believe that the major players with their massive branding campaigns together with the margins applied by distributors and retailers are a business model that doesnΓ’ΒΒt deliver a fair value to customers.,32
|
30 |
-
28,1505209,"If you want to take advantage of the Rhino Slider's versatility, you'll have an option to add extra sets of rails after the campaign ends.",25
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/example.csv
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ο»Ώcontent,
|
2 |
+
What are some of your favorite jokes? Let us know!,cov
|
3 |
+
Is anyone being creative with their snow day? ,cov
|
4 |
+
Did you see our latest movie?,cov
|
5 |
+
Come hang out with us! ,cov
|
6 |
+
Hey beautiful people! What would you like to see us doing more (or less) of !,cov
|
7 |
+
Ends tonight! Shop select certifiably comfortable shoes!,Assertive
|
8 |
+
Just Do it! ,Assertive
|
9 |
+
Don't miss our products !,Assertive
|
10 |
+
"In fact, we discovered that Woollip works better that what we imagined.",Infor
|
11 |
+
"It is made of Titanium Grade 5, a material famous for being very strong yet very light.",Infor
|
12 |
+
Each game already comes with six characters.,Infor
|
13 |
+
We thank you personally for the trust you are putting in us and our company.,Emo
|
14 |
+
I wear it everyday and am very happy with it!,Emo
|
15 |
+
We are so grateful for our everyday heroes who never cease to amaze us!,Emo
|
assets/examples.txt
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
1 |
+
What are some of your favorite jokes? Let us know!
|
2 |
+
Is anyone being creative with their snow day?
|
3 |
+
Did you see our latest movie?
|
4 |
+
Come hang out with us!
|
5 |
+
Hey beautiful people! What would you like to see us doing more (or less) of !
|
6 |
+
Ends tonight! Shop select certifiably comfortable shoes!
|
7 |
+
Just Do it!
|
8 |
+
Don't miss our products !
|
9 |
+
In fact, we discovered that Woollip works better that what we imagined.
|
10 |
+
It is made of Titanium Grade 5, a material famous for being very strong yet very light.
|
11 |
+
Each game already comes with six characters.
|
12 |
+
We thank you personally for the trust you are putting in us and our company.
|
13 |
+
I wear it everyday and am very happy with it!
|
14 |
+
We are so grateful for our everyday heroes who never cease to amaze us!
|
convert.py
CHANGED
@@ -3,10 +3,12 @@ import glob
|
|
3 |
import os
|
4 |
from transformers import BertTokenizerFast as BertTokenizer, BertForSequenceClassification
|
5 |
|
6 |
-
|
|
|
|
|
7 |
|
8 |
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
|
9 |
-
model = BertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=
|
10 |
id2label = {i:label for i,label in enumerate(LABEL_COLUMNS)}
|
11 |
label2id = {label:i for i,label in enumerate(LABEL_COLUMNS)}
|
12 |
|
|
|
3 |
import os
|
4 |
from transformers import BertTokenizerFast as BertTokenizer, BertForSequenceClassification
|
5 |
|
6 |
+
os.environ['https_proxy'] = "127.0.0.1:1081"
|
7 |
+
|
8 |
+
LABEL_COLUMNS = ["Assertive Tone", "Conversational Tone", "Emotional Tone", "Informative Tone", "None"]
|
9 |
|
10 |
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
|
11 |
+
model = BertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=5)
|
12 |
id2label = {i:label for i,label in enumerate(LABEL_COLUMNS)}
|
13 |
label2id = {label:i for i,label in enumerate(LABEL_COLUMNS)}
|
14 |
|
models/All_Data/config.json
CHANGED
@@ -13,7 +13,8 @@
|
|
13 |
"0": "Assertive Tone",
|
14 |
"1": "Conversational Tone",
|
15 |
"2": "Emotional Tone",
|
16 |
-
"3": "Informative Tone"
|
|
|
17 |
},
|
18 |
"initializer_range": 0.02,
|
19 |
"intermediate_size": 3072,
|
@@ -21,7 +22,8 @@
|
|
21 |
"Assertive Tone": 0,
|
22 |
"Conversational Tone": 1,
|
23 |
"Emotional Tone": 2,
|
24 |
-
"Informative Tone": 3
|
|
|
25 |
},
|
26 |
"layer_norm_eps": 1e-12,
|
27 |
"max_position_embeddings": 512,
|
|
|
13 |
"0": "Assertive Tone",
|
14 |
"1": "Conversational Tone",
|
15 |
"2": "Emotional Tone",
|
16 |
+
"3": "Informative Tone",
|
17 |
+
"4": "None"
|
18 |
},
|
19 |
"initializer_range": 0.02,
|
20 |
"intermediate_size": 3072,
|
|
|
22 |
"Assertive Tone": 0,
|
23 |
"Conversational Tone": 1,
|
24 |
"Emotional Tone": 2,
|
25 |
+
"Informative Tone": 3,
|
26 |
+
"None": 4
|
27 |
},
|
28 |
"layer_norm_eps": 1e-12,
|
29 |
"max_position_embeddings": 512,
|
models/All_Data/pytorch_model.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:593dc3210abcc95df5a0f63580ce571df2b60c39cc4f1d7122e371c9f37c4c64
|
3 |
+
size 438024366
|
models/Facebook/config.json
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_name_or_path": "bert-base-uncased",
|
3 |
-
"architectures": [
|
4 |
-
"BertForSequenceClassification"
|
5 |
-
],
|
6 |
-
"attention_probs_dropout_prob": 0.1,
|
7 |
-
"classifier_dropout": null,
|
8 |
-
"gradient_checkpointing": false,
|
9 |
-
"hidden_act": "gelu",
|
10 |
-
"hidden_dropout_prob": 0.1,
|
11 |
-
"hidden_size": 768,
|
12 |
-
"id2label": {
|
13 |
-
"0": "Assertive Tone",
|
14 |
-
"1": "Conversational Tone",
|
15 |
-
"2": "Emotional Tone",
|
16 |
-
"3": "Informative Tone"
|
17 |
-
},
|
18 |
-
"initializer_range": 0.02,
|
19 |
-
"intermediate_size": 3072,
|
20 |
-
"label2id": {
|
21 |
-
"Assertive Tone": 0,
|
22 |
-
"Conversational Tone": 1,
|
23 |
-
"Emotional Tone": 2,
|
24 |
-
"Informative Tone": 3
|
25 |
-
},
|
26 |
-
"layer_norm_eps": 1e-12,
|
27 |
-
"max_position_embeddings": 512,
|
28 |
-
"model_type": "bert",
|
29 |
-
"num_attention_heads": 12,
|
30 |
-
"num_hidden_layers": 12,
|
31 |
-
"pad_token_id": 0,
|
32 |
-
"position_embedding_type": "absolute",
|
33 |
-
"transformers_version": "4.36.2",
|
34 |
-
"type_vocab_size": 2,
|
35 |
-
"use_cache": true,
|
36 |
-
"vocab_size": 30522
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
models/Facebook/pytorch_model.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:f511b8b4b91b5fa408c5b3220ce0fe9b61b2f9a3a54dd00acb3a81aa0a2a19e8
|
3 |
-
size 438021294
|
|
|
|
|
|
|
|
models/Facebook/vocab.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
models/Kickstarter/config.json
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_name_or_path": "bert-base-uncased",
|
3 |
-
"architectures": [
|
4 |
-
"BertForSequenceClassification"
|
5 |
-
],
|
6 |
-
"attention_probs_dropout_prob": 0.1,
|
7 |
-
"classifier_dropout": null,
|
8 |
-
"gradient_checkpointing": false,
|
9 |
-
"hidden_act": "gelu",
|
10 |
-
"hidden_dropout_prob": 0.1,
|
11 |
-
"hidden_size": 768,
|
12 |
-
"id2label": {
|
13 |
-
"0": "Assertive Tone",
|
14 |
-
"1": "Conversational Tone",
|
15 |
-
"2": "Emotional Tone",
|
16 |
-
"3": "Informative Tone"
|
17 |
-
},
|
18 |
-
"initializer_range": 0.02,
|
19 |
-
"intermediate_size": 3072,
|
20 |
-
"label2id": {
|
21 |
-
"Assertive Tone": 0,
|
22 |
-
"Conversational Tone": 1,
|
23 |
-
"Emotional Tone": 2,
|
24 |
-
"Informative Tone": 3
|
25 |
-
},
|
26 |
-
"layer_norm_eps": 1e-12,
|
27 |
-
"max_position_embeddings": 512,
|
28 |
-
"model_type": "bert",
|
29 |
-
"num_attention_heads": 12,
|
30 |
-
"num_hidden_layers": 12,
|
31 |
-
"pad_token_id": 0,
|
32 |
-
"position_embedding_type": "absolute",
|
33 |
-
"transformers_version": "4.36.2",
|
34 |
-
"type_vocab_size": 2,
|
35 |
-
"use_cache": true,
|
36 |
-
"vocab_size": 30522
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
models/Kickstarter/pytorch_model.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b98553cd5a9b23babc4e20ade9abda931497de3103acf09656eb39cfcbb0c485
|
3 |
-
size 438021294
|
|
|
|
|
|
|
|
models/Kickstarter/vocab.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
models/Twitter/config.json
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_name_or_path": "bert-base-uncased",
|
3 |
-
"architectures": [
|
4 |
-
"BertForSequenceClassification"
|
5 |
-
],
|
6 |
-
"attention_probs_dropout_prob": 0.1,
|
7 |
-
"classifier_dropout": null,
|
8 |
-
"gradient_checkpointing": false,
|
9 |
-
"hidden_act": "gelu",
|
10 |
-
"hidden_dropout_prob": 0.1,
|
11 |
-
"hidden_size": 768,
|
12 |
-
"id2label": {
|
13 |
-
"0": "Assertive Tone",
|
14 |
-
"1": "Conversational Tone",
|
15 |
-
"2": "Emotional Tone",
|
16 |
-
"3": "Informative Tone"
|
17 |
-
},
|
18 |
-
"initializer_range": 0.02,
|
19 |
-
"intermediate_size": 3072,
|
20 |
-
"label2id": {
|
21 |
-
"Assertive Tone": 0,
|
22 |
-
"Conversational Tone": 1,
|
23 |
-
"Emotional Tone": 2,
|
24 |
-
"Informative Tone": 3
|
25 |
-
},
|
26 |
-
"layer_norm_eps": 1e-12,
|
27 |
-
"max_position_embeddings": 512,
|
28 |
-
"model_type": "bert",
|
29 |
-
"num_attention_heads": 12,
|
30 |
-
"num_hidden_layers": 12,
|
31 |
-
"pad_token_id": 0,
|
32 |
-
"position_embedding_type": "absolute",
|
33 |
-
"transformers_version": "4.36.2",
|
34 |
-
"type_vocab_size": 2,
|
35 |
-
"use_cache": true,
|
36 |
-
"vocab_size": 30522
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
models/Twitter/pytorch_model.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:6abf83c8c66c4f3fcaba340dcab3b5b1f4f2b66381b21a5aacab086194cf0cbd
|
3 |
-
size 438021294
|
|
|
|
|
|
|
|
models/Twitter/vocab.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
tmp.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
|
3 |
+
pd.read_csv('output/example.csv')
|
4 |
+
pd.inde
|
5 |
+
...
|