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:26:28 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
531d310916deaccc001376214b67086bc6068c2d
531d3109
1 parent
348e1c78
LSA word embedding examples
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
sentence-representation/lsa_example.py
sentence-representation/lsa_example.py
View file @
531d310
...
...
@@ -106,13 +106,13 @@ for pertenence, sentence in zip(corpus_lsa, sentences):
if
n_docs
<=
0
:
#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
x
range
(
n_topics
)]
for
x
in
range
(
n_topics
)]
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
x
range
(
n_topics
)]
for
x
in
range
(
n_topics
)]
print
(
"
%
s
\t\t
%
s"
%
(
pertenence
,
sentence
))
n
+=
1
else
:
...
...
Please
register
or
login
to post a comment