Skip to content
Snippets Groups Projects
Commit 9f47bb77 authored by opitz's avatar opitz
Browse files

fixed the case where a trial has no category

parent 0ac08cf4
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,11 @@ def simplify_text_description_nodes(G,node_index_dict,mode="None",min_freq=1):
# we iterate over all trials
for i,tn in enumerate(trialnodes):
#get corresponding cat node
catn = [n for n in G.neighbors(tn[0]) if isinstance(G.nodes[n]["nodeobj"],dh.OffenceNode)][0]
catn = [n for n in G.neighbors(tn[0]) if isinstance(G.nodes[n]["nodeobj"],dh.OffenceNode)]
if not catn:
continue
else:
catn=catn[0]
catn=[catn,G.nodes[catn]]
category=catn[1]["nodeobj"].d["category"]
descr_vectors = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment