Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
lcg-faaa
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-10-04 21:39:03 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f475f0eda0c1e7b99d6bdff8131c8301d46fa7b8
f475f0ed
1 parent
7e524420
LSA soft clustering
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
agrupamiento-datos-categoricos/lsa-soft-clustering.py
agrupamiento-datos-categoricos/lsa-soft-clustering.py
View file @
f475f0e
...
...
@@ -105,12 +105,12 @@ 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
(
"{} {}"
.
format
(
""
.
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