Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Flor Miriam Plaza del Arco
/
WASSA 2018
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
82e1a3eb
authored
Jun 22, 2018
by
Flor Miriam Plaza del Arco
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Actualización código
parent
7373f811
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
4 deletions
embeddings_RNN.py
embeddings_RNN.py
View file @
82e1a3eb
...
...
@@ -121,10 +121,8 @@ def classification_embedings_rnn(tweets_train, tweets_train_labels_numeric, twee
embedding_matrix
[
index
]
=
embedding_vector
#max_len_input = 30
train_features_pad
=
sequence
.
pad_sequences
(
corpus_train_index
,
maxlen
=
max_len_input
,
padding
=
"post"
,
truncating
=
"post"
,
dtype
=
type
(
corpus_train_index
[
0
][
0
]))
# define RNN model
model
=
Sequential
()
...
...
@@ -139,7 +137,7 @@ def classification_embedings_rnn(tweets_train, tweets_train_labels_numeric, twee
model
.
add
(
Dense
(
len
(
CLASSES
),
activation
=
'softmax'
))
# compile the model
model
.
compile
(
optimizer
=
'adam'
,
loss
=
'
binary
_crossentropy'
,
metrics
=
[
'acc'
])
model
.
compile
(
optimizer
=
'adam'
,
loss
=
'
categorical
_crossentropy'
,
metrics
=
[
'acc'
])
# summarize the model
print
(
model
.
summary
())
...
...
@@ -175,6 +173,5 @@ def main ():
tweets_dev_classified_labels
=
classification_embedings_rnn
(
tweets_train
,
tweets_train_labels_numeric
,
tweets_dev
)
calculate_quality_performamnce
(
tweets_dev_labels
,
tweets_dev_classified_labels
,
"RNN_LSTM"
)
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment