-
Notifications
You must be signed in to change notification settings - Fork 0
/
embedding_generation.py
133 lines (130 loc) · 3.4 KB
/
embedding_generation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import torch
from sent2vec.vectorizer import Vectorizer
import pickle
sentences = [
'drink water.',
'eat meal/snack.',
'brushing teeth.',
'brushing hair.',
'drop.',
'pickup.',
'throw.',
'sitting down.',
'standing up from sitting position.',
'clapping.',
'reading.',
'writing.',
'tear up paper.',
'wear jacket.',
'take off jacket.',
'wear a shoe.',
'take off a shoe.',
'wear on glasses.',
'ake off glasses.',
'put on a hat/cap.',
'take off a hat/cap.',
'cheer up.',
'hand waving.',
'kicking something.',
'reach into pocket.',
'hopping (one foot jumping).',
'jump up.',
'make a phone call/answer phone.',
'playing with phone/tablet.',
'typing on a keyboard.',
'pointing to something with finger.',
'taking a selfie.',
'check time (from watch).',
'rub two hands together.',
'nod head/bow.',
'shake head.',
'wipe face.',
'salute.',
'put the palms together.',
'cross hands in front (say stop).',
'sneeze/cough.',
'staggering.',
'falling.',
'touch head (headache).',
'touch chest (stomachache/heart pain).',
'touch back (backache).',
'touch neck (neckache).',
'nausea or vomiting condition.',
'use a fan (with hand or paper)/feeling warm.',
'punching/slapping other person.',
'kicking other person.',
'pushing other person.',
'pat on back of other person.',
'point finger at the other person.',
'hugging other person.',
'giving something to other person.',
'touch other person pocket.',
'handshaking.',
'walking towards each other.',
'walking apart from each other.',
'put on headphone.',
'take off headphone.',
'shoot at the basket.',
'bounce ball.',
'tennis bat swing.',
'juggling table tennis balls.',
'hush (quite).',
'flick hair.',
'thumb up.',
'thumb down.',
'make ok sign.',
'make victory sign.',
'staple book.',
'counting money.',
'cutting nails.',
'cutting paper (using scissors).',
'snapping fingers.',
'open bottle.',
'sniff (smell).',
'squat down.',
'toss a coin.',
'fold paper.',
'ball up paper.',
'play magic cube.',
'apply cream on face.',
'apply cream on hand back.',
'put on bag.',
'take off bag.',
'put something into a bag.',
'take something out of a bag.',
'open a box.',
'move heavy objects.',
'shake fist.',
'throw up cap/hat.',
'hands up with both hands.',
'cross arms.',
'arm circles.',
'arm swings.',
'running on the spot.',
'butt kicks (kick backward).',
'cross toe touch.',
'side kick.',
'yawn.',
'stretch oneself.',
'blow nose.',
'hit other person with something.',
'wield knife towards other person.',
'knock over other person (hit with body).',
'grab other person’s stuff.',
'shoot at other person with a gun.',
'step on foot.',
'high-five.',
'cheers and drink.',
'carry something with other person.',
'take a photo of other person.',
'follow other person.',
'whisper in other person’s ear.',
'exchange things with other person.',
'support somebody with hand.',
'finger-guessing game (playing rock-paper-scissors).'
]
vectorizer = Vectorizer()
vectorizer.bert(sentences)
vectors = vectorizer.vectors
with open('word_embedding_ntu.pkl', 'wb') as f:
pickle.dump(vectors, f)