Spaces:
Runtime error
Runtime error
hacpdsae2023
commited on
Commit
·
b6c7b40
1
Parent(s):
1fdb11f
test size of network and adding labels to nodes
Browse files
app.py
CHANGED
@@ -15,8 +15,8 @@ model = SentenceTransformer('all-MiniLM-L6-v2')
|
|
15 |
# Sentences from the data set
|
16 |
#sentences = [item['text'] for item in dataset['train'][:10]]
|
17 |
|
18 |
-
sentences = [dataset['train'][0],dataset['train'][1],dataset['train'][2]]
|
19 |
-
|
20 |
|
21 |
#Compute embedding
|
22 |
embeddings = model.encode(sentences, convert_to_tensor=True)
|
@@ -77,7 +77,7 @@ degree = G.degree(most_connected_node)
|
|
77 |
hub_ego = nx.ego_graph(G, most_connected_node[0])
|
78 |
|
79 |
# Now create the equivalent Node and Edge lists
|
80 |
-
nodes = [Node(id=i, label=str(i), size=20) for i in hub_ego.nodes]
|
81 |
edges = [Edge(source=i, target=j, type="CURVE_SMOOTH") for (i,j) in G.edges
|
82 |
if i in hub_ego.nodes and j in hub_ego.nodes]
|
83 |
|
|
|
15 |
# Sentences from the data set
|
16 |
#sentences = [item['text'] for item in dataset['train'][:10]]
|
17 |
|
18 |
+
#sentences = [dataset['train'][0],dataset['train'][1],dataset['train'][2]]
|
19 |
+
sentences = [dataset['train'][ii] for ii in range(10)]
|
20 |
|
21 |
#Compute embedding
|
22 |
embeddings = model.encode(sentences, convert_to_tensor=True)
|
|
|
77 |
hub_ego = nx.ego_graph(G, most_connected_node[0])
|
78 |
|
79 |
# Now create the equivalent Node and Edge lists
|
80 |
+
nodes = [Node(id=i, label='node_'+str(i), size=20) for i in hub_ego.nodes]
|
81 |
edges = [Edge(source=i, target=j, type="CURVE_SMOOTH") for (i,j) in G.edges
|
82 |
if i in hub_ego.nodes and j in hub_ego.nodes]
|
83 |
|