Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
sentence-representation-word-embeddings
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Carlos-Francisco Méndez-Cruz
2018-03-09 08:23:24 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2fc5dae8b549a8d0d287f7be1592e600c8d73533
2fc5dae8
1 parent
426b16cc
LSA word embedding examples
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
sentence-representation/lsa_example.py
sentence-representation/lsa_example.py
View file @
2fc5dae
...
...
@@ -107,13 +107,13 @@ for pertenence, sentence in zip(corpus_lsa, sentences):
#print "%s\t\t%s" % (pertenence, sentence.split("\t")[0])
p
=
[
dict
(
pertenence
)[
x
]
if
x
in
dict
(
pertenence
)
else
0.0
for
x
in
xrange
(
n_topics
)]
print
"
%
s
%
s"
%
(
""
.
join
(
sentence
.
split
(
"
\t
"
)[
0
]
.
split
()),
""
.
join
(
str
(
p
)[
1
:]
.
strip
(
"]"
)
.
split
(
","
))
)
print
(
"
%
s
%
s"
%
(
""
.
join
(
sentence
.
split
(
"
\t
"
)[
0
]
.
split
()),
""
.
join
(
str
(
p
)[
1
:]
.
strip
(
"]"
)
.
split
(
","
))
)
)
else
:
if
n
<
n_docs
:
pertenence
=
[
dict
(
pertenence
)[
x
]
if
x
in
dict
(
pertenence
)
else
0.0
for
x
in
xrange
(
n_topics
)]
print
"
%
s
\t\t
%
s"
%
(
pertenence
,
sentence
)
print
(
"
%
s
\t\t
%
s"
%
(
pertenence
,
sentence
)
)
n
+=
1
else
:
break
...
...
Please
register
or
login
to post a comment