Arylwen commited on
Commit
bf1eda4
1 Parent(s): 43871f1

0.1.0 suggested topics and ethics tab

Browse files
Files changed (2) hide show
  1. app.py +99 -14
  2. graph.html +2 -2
app.py CHANGED
@@ -5,6 +5,7 @@ import re
5
  import sys
6
  import time
7
  import base64
 
8
  import logging
9
  logging.basicConfig(stream=sys.stdout, level=logging.INFO)
10
  logger = logging.getLogger(__name__)
@@ -12,8 +13,6 @@ logger = logging.getLogger(__name__)
12
  from dotenv import load_dotenv
13
  load_dotenv()
14
 
15
- #os.environ['AWS_DEFAULT_REGION'] = 'us-west-2'
16
-
17
  for key in st.session_state.keys():
18
  #del st.session_state[key]
19
  print(f'session state entry: {key} {st.session_state[key]}')
@@ -69,10 +68,10 @@ f'''
69
  )
70
  st.caption('''###### corpus by [@ArxivHealthcareNLP@sigmoid.social](https://sigmoid.social/@ArxivHealthcareNLP)''')
71
  st.caption('''###### KG Questions by [arylwen](https://github.com/arylwen/mlk8s)''')
72
- st.write(
73
- f'''
74
- #### How can <what most are doing> help with <what few are doing>?
75
- ''')
76
 
77
  from llama_index import StorageContext
78
  from llama_index import ServiceContext
@@ -117,7 +116,7 @@ def get_hf_predictor(query_model):
117
  # no embeddings for now
118
  set_openai_local()
119
  llm=HuggingFaceHub(repo_id=query_model, task="text-generation",
120
- model_kwargs={"temperature": 0.01, "max_length": MAX_LENGTH},
121
  huggingfacehub_api_token=hf_api_key)
122
  llm_predictor = LLMPredictor(llm)
123
  return llm_predictor
@@ -157,6 +156,26 @@ def get_servce_context(llm_predictor):
157
  service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, node_parser=node_parser)
158
  return service_context
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  def get_index(service_context, persist_path):
161
  print(f'Loading index from {persist_path}')
162
  # rebuild storage context
@@ -166,6 +185,8 @@ def get_index(service_context, persist_path):
166
  service_context=service_context,
167
  max_triplets_per_chunk=2,
168
  show_progress = False)
 
 
169
  return index
170
 
171
  def get_query_engine(index):
@@ -237,7 +258,7 @@ if __spaces__ :
237
  with query:
238
  answer_model = st.radio(
239
  "Choose the model used for inference:",
240
- ('baseten/Camel-5b', 'cohere/command','hf/tiiuae/falcon-7b-instruct', 'openai/text-davinci-003') #TODO start hf inference container on demand
241
  )
242
  else :
243
  with query:
@@ -252,31 +273,55 @@ if answer_model == 'openai/text-davinci-003':
252
  clear_question(query_model)
253
  set_openai()
254
  query_engine = build_kron_query_engine(query_model, persist_path)
 
 
 
 
255
  elif answer_model == 'hf/tiiuae/falcon-7b-instruct':
256
  print(answer_model)
257
  query_model = 'tiiuae/falcon-7b-instruct'
258
  clear_question(query_model)
259
  query_engine = build_hf_query_engine(query_model, persist_path)
 
 
 
 
260
  elif answer_model == 'cohere/command':
261
  print(answer_model)
262
  query_model = 'cohere/command'
263
  clear_question(query_model)
264
  query_engine = build_cohere_query_engine(query_model, persist_path)
 
 
 
 
265
  elif answer_model == 'baseten/Camel-5b':
266
  print(answer_model)
267
  query_model = 'baseten/Camel-5b'
268
  clear_question(query_model)
269
  query_engine = build_baseten_query_engine(query_model, persist_path)
 
 
 
 
270
  elif answer_model == 'Local-Camel':
271
  query_model = 'Writer/camel-5b-hf'
272
  print(answer_model)
273
  clear_question(query_model)
274
  set_openai_local()
275
  query_engine = build_kron_query_engine(query_model, persist_path)
 
 
 
 
276
  elif answer_model == 'HF-TKI':
277
  query_model = 'allenai/tk-instruct-3b-def-pos-neg-expl'
278
  clear_question(query_model)
279
  query_engine = build_hf_query_engine(query_model, persist_path)
 
 
 
 
280
  else:
281
  print('This is a bug.')
282
 
@@ -286,15 +331,16 @@ def submit():
286
  st.session_state.question_input = ''
287
  st.session_state.question_answered = False
288
 
 
 
 
 
289
  with query:
290
- st.caption(f'''###### Model, question, answer and rating are logged to improve KG Questions.''')
 
291
  question = st.text_input("Enter a question, e.g. What benchmarks can we use for QA?", key='question_input', on_change=submit )
292
 
293
- if(st.session_state.question):
294
-
295
- #with col1:
296
- # st.write(f'Answering: {st.session_state.question} with {query_model}.')
297
-
298
  try :
299
  with query:
300
  col1, col2 = st.columns([2, 2])
@@ -390,6 +436,45 @@ if(st.session_state.question):
390
  st.write(df.to_html(escape=False), unsafe_allow_html=True)
391
  # reference text wordcloud
392
  #st.session_state.reference_wcloud = all_reference_texts
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
393
 
394
  except Exception as e:
395
  #print(f'{type(e)}, {e}')
 
5
  import sys
6
  import time
7
  import base64
8
+ import random
9
  import logging
10
  logging.basicConfig(stream=sys.stdout, level=logging.INFO)
11
  logger = logging.getLogger(__name__)
 
13
  from dotenv import load_dotenv
14
  load_dotenv()
15
 
 
 
16
  for key in st.session_state.keys():
17
  #del st.session_state[key]
18
  print(f'session state entry: {key} {st.session_state[key]}')
 
68
  )
69
  st.caption('''###### corpus by [@ArxivHealthcareNLP@sigmoid.social](https://sigmoid.social/@ArxivHealthcareNLP)''')
70
  st.caption('''###### KG Questions by [arylwen](https://github.com/arylwen/mlk8s)''')
71
+ # st.write(
72
+ #f'''
73
+ ##### How can <what most are doing> help with <what few are doing>?
74
+ #''')
75
 
76
  from llama_index import StorageContext
77
  from llama_index import ServiceContext
 
116
  # no embeddings for now
117
  set_openai_local()
118
  llm=HuggingFaceHub(repo_id=query_model, task="text-generation",
119
+ model_kwargs={"temperature": 0.01, "max_new_tokens": MAX_LENGTH, 'frequency_penalty':1.17},
120
  huggingfacehub_api_token=hf_api_key)
121
  llm_predictor = LLMPredictor(llm)
122
  return llm_predictor
 
156
  service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, node_parser=node_parser)
157
  return service_context
158
 
159
+ # hack - on subsequent calls we can pass anything as index
160
+ @st.cache_data
161
+ def get_networkx_graph_nodes(_index, persist_path):
162
+ g = _index.get_networkx_graph(100000)
163
+ sorted_nodes = sorted(g.degree, key = lambda x: x[1], reverse=True)
164
+ return sorted_nodes
165
+
166
+ @st.cache_data
167
+ def get_networkx_low_connected_components(_index, persist_path):
168
+ g = _index.get_networkx_graph(100000)
169
+ import networkx as nx
170
+ sorted_c = [c for c in sorted(nx.connected_components(g), key=len, reverse=False)]
171
+ #print(sorted_c[:100])
172
+ low_terms = []
173
+ for c in sorted_c:
174
+ for cc in c:
175
+ low_terms.extend([cc])
176
+ #print(low_terms)
177
+ return low_terms
178
+
179
  def get_index(service_context, persist_path):
180
  print(f'Loading index from {persist_path}')
181
  # rebuild storage context
 
185
  service_context=service_context,
186
  max_triplets_per_chunk=2,
187
  show_progress = False)
188
+ get_networkx_graph_nodes(index, persist_path)
189
+ get_networkx_low_connected_components(index, persist_path)
190
  return index
191
 
192
  def get_query_engine(index):
 
258
  with query:
259
  answer_model = st.radio(
260
  "Choose the model used for inference:",
261
+ ('hf/tiiuae/falcon-7b-instruct', 'cohere/command', 'baseten/Camel-5b', 'openai/text-davinci-003') #TODO start hf inference container on demand
262
  )
263
  else :
264
  with query:
 
273
  clear_question(query_model)
274
  set_openai()
275
  query_engine = build_kron_query_engine(query_model, persist_path)
276
+ graph_nodes = get_networkx_graph_nodes( "", persist_path)
277
+ most_connected = random.sample(graph_nodes[:100], 5)
278
+ low_connected = get_networkx_low_connected_components( "", persist_path)
279
+ least_connected = random.sample(low_connected, 5)
280
  elif answer_model == 'hf/tiiuae/falcon-7b-instruct':
281
  print(answer_model)
282
  query_model = 'tiiuae/falcon-7b-instruct'
283
  clear_question(query_model)
284
  query_engine = build_hf_query_engine(query_model, persist_path)
285
+ graph_nodes = get_networkx_graph_nodes( "", persist_path)
286
+ most_connected = random.sample(graph_nodes[:100], 5)
287
+ low_connected = get_networkx_low_connected_components( "", persist_path)
288
+ least_connected = random.sample(low_connected, 5)
289
  elif answer_model == 'cohere/command':
290
  print(answer_model)
291
  query_model = 'cohere/command'
292
  clear_question(query_model)
293
  query_engine = build_cohere_query_engine(query_model, persist_path)
294
+ graph_nodes = get_networkx_graph_nodes( "", persist_path)
295
+ most_connected = random.sample(graph_nodes[:100], 5)
296
+ low_connected = get_networkx_low_connected_components( "", persist_path)
297
+ least_connected = random.sample(low_connected, 5)
298
  elif answer_model == 'baseten/Camel-5b':
299
  print(answer_model)
300
  query_model = 'baseten/Camel-5b'
301
  clear_question(query_model)
302
  query_engine = build_baseten_query_engine(query_model, persist_path)
303
+ graph_nodes = get_networkx_graph_nodes( "", persist_path)
304
+ most_connected = random.sample(graph_nodes[:100], 5)
305
+ low_connected = get_networkx_low_connected_components( "", persist_path)
306
+ least_connected = random.sample(low_connected, 5)
307
  elif answer_model == 'Local-Camel':
308
  query_model = 'Writer/camel-5b-hf'
309
  print(answer_model)
310
  clear_question(query_model)
311
  set_openai_local()
312
  query_engine = build_kron_query_engine(query_model, persist_path)
313
+ graph_nodes = get_networkx_graph_nodes( "", persist_path)
314
+ most_connected = random.sample(graph_nodes[:100], 5)
315
+ low_connected = get_networkx_low_connected_components( "", persist_path)
316
+ least_connected = random.sample(low_connected, 5)
317
  elif answer_model == 'HF-TKI':
318
  query_model = 'allenai/tk-instruct-3b-def-pos-neg-expl'
319
  clear_question(query_model)
320
  query_engine = build_hf_query_engine(query_model, persist_path)
321
+ graph_nodes = get_networkx_graph_nodes( "", persist_path)
322
+ most_connected = random.sample(graph_nodes[:100], 5)
323
+ low_connected = get_networkx_low_connected_components( "", persist_path)
324
+ least_connected = random.sample(low_connected, 5)
325
  else:
326
  print('This is a bug.')
327
 
 
331
  st.session_state.question_input = ''
332
  st.session_state.question_answered = False
333
 
334
+ with st.sidebar:
335
+ option_1 = st.selectbox("What most are studying:", most_connected, disabled=True)
336
+ option_2 = st.selectbox("What few are studying:", least_connected, disabled=True)
337
+
338
  with query:
339
+ st.caption(f'''###### Only intended for educational and research purposes. Please do not enter any private or confidential information. Model, question, answer and rating are logged to improve KG Questions.''')
340
+ #st.caption(f'''Model, question, answer and rating are logged to improve KG Questions.''')
341
  question = st.text_input("Enter a question, e.g. What benchmarks can we use for QA?", key='question_input', on_change=submit )
342
 
343
+ if(st.session_state.question):
 
 
 
 
344
  try :
345
  with query:
346
  col1, col2 = st.columns([2, 2])
 
436
  st.write(df.to_html(escape=False), unsafe_allow_html=True)
437
  # reference text wordcloud
438
  #st.session_state.reference_wcloud = all_reference_texts
439
+
440
+ with ethical:
441
+ st.write('##### Bias, risks, limitations and terms of use for the models.')
442
+ ethics_statement = []
443
+ falcon = ['hf/tiiuae/falcon-7b-instruct', '<a target="_blank" href="https://huggingface.co/tiiuae/falcon-7b">Bias, Risks, and Limitations</a>']
444
+ cohere = ['cohere/command', '<a target="_blank" href="https://cohere.com/terms-of-use">Terms of use</a>']
445
+ camel = ['baseten/Camel-5b', '<a target="_blank" href="https://huggingface.co/Writer/camel-5b-hf">Bias, Risks, and Limitations</a>']
446
+ davinci = ['openai/text-davinci-003', '<a target="_blank" href="https://openai.com/policies/terms-of-use">Terms of Use</a>']
447
+
448
+ ethics_statement.extend([falcon, cohere, camel, davinci])
449
+ df = pd.DataFrame(ethics_statement)
450
+ df.columns = ['model', 'model link']
451
+ st.markdown(""" <style>
452
+ table[class*="dataframe"] {
453
+ font-size: 14px;
454
+ }
455
+ </style> """, unsafe_allow_html=True)
456
+ st.write(df.to_html(escape=False), unsafe_allow_html=True)
457
+ # license
458
+ st.write('')
459
+ st.write('##### How papers were included in the index based on license.')
460
+ st.caption(f'The paper id and title has been included in the index for a full attribution to the authors')
461
+ ccby = ['<a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">CC BY</a>',
462
+ '<a target="_blank" href="https://github.com/arylwen/mlk8s/tree/main/apps/papers-kg">full content KG questions pipeline</a>']
463
+ ccbysa = ['<a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a>',
464
+ '<a target="_blank" href="https://github.com/arylwen/mlk8s/tree/main/apps/papers-kg">full content KG questions pipeline</a>']
465
+ ccbyncsa = ['<a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC NC-BY-NC-SA</a>',
466
+ '<a target="_blank" href="https://github.com/arylwen/mlk8s/tree/main/apps/papers-kg">full content KG questions pipeline</a>']
467
+ ccbyncnd = ['<a target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/">CC NC-BY-NC-ND</a>',
468
+ '<a target="_blank" href="https://github.com/arylwen/mlk8s/tree/main/apps/papers-kg">arxiv metadata abstract KG questions pipeline</a>']
469
+ license_statement = [ccby, ccbysa, ccbyncsa, ccbyncnd]
470
+ df = pd.DataFrame(license_statement)
471
+ df.columns = ['license', 'how papers are used']
472
+ st.markdown(""" <style>
473
+ table[class*="dataframe"] {
474
+ font-size: 14px;
475
+ }
476
+ </style> """, unsafe_allow_html=True)
477
+ st.write(df.to_html(escape=False), unsafe_allow_html=True)
478
 
479
  except Exception as e:
480
  #print(f'{type(e)}, {e}')
graph.html CHANGED
@@ -88,8 +88,8 @@
88
 
89
 
90
  // parsing and collecting nodes and edges from the python
91
- nodes = new vis.DataSet([{"color": "#97c2fc", "id": "TKM", "label": "TKM", "shape": "dot", "title": "TKM"}, {"color": "#97c2fc", "id": "decision-making", "label": "decision-making", "shape": "dot", "title": "decision-making"}, {"color": "#97c2fc", "id": "semantic web", "label": "semantic web", "shape": "dot", "title": "semantic web"}, {"color": "#97c2fc", "id": "ontologies", "label": "ontologies", "shape": "dot", "title": "ontologies"}, {"color": "#97c2fc", "id": "data", "label": "data", "shape": "dot", "title": "data"}, {"color": "#97c2fc", "id": "deep learning models", "label": "deep learning models", "shape": "dot", "title": "deep learning models"}, {"color": "#97c2fc", "id": "patient outcomes prediction", "label": "patient outcomes prediction", "shape": "dot", "title": "patient outcomes prediction"}, {"color": "#97c2fc", "id": "post-discharge readmissions", "label": "post-discharge readmissions", "shape": "dot", "title": "post-discharge readmissions"}, {"color": "#97c2fc", "id": "information", "label": "information", "shape": "dot", "title": "information"}, {"color": "#97c2fc", "id": "tabular and unstructured", "label": "tabular and unstructured", "shape": "dot", "title": "tabular and unstructured"}, {"color": "#97c2fc", "id": "enrich", "label": "enrich", "shape": "dot", "title": "enrich"}, {"color": "#97c2fc", "id": "BERT base tokenizer", "label": "BERT base tokenizer", "shape": "dot", "title": "BERT base tokenizer"}, {"color": "#97c2fc", "id": "BERT variant models", "label": "BERT variant models", "shape": "dot", "title": "BERT variant models"}, {"color": "#97c2fc", "id": "BERT variants in medical domain", "label": "BERT variants in medical domain", "shape": "dot", "title": "BERT variants in medical domain"}, {"color": "#97c2fc", "id": "approach", "label": "approach", "shape": "dot", "title": "approach"}, {"color": "#97c2fc", "id": "biomedical", "label": "biomedical", "shape": "dot", "title": "biomedical"}, {"color": "#97c2fc", "id": "multimodal", "label": "multimodal", "shape": "dot", "title": "multimodal"}, {"color": "#97c2fc", "id": "instruction", "label": "instruction", "shape": "dot", "title": "instruction"}, {"color": "#97c2fc", "id": "responses", "label": "responses", "shape": "dot", "title": "responses"}, {"color": "#97c2fc", "id": "visual", "label": "visual", "shape": "dot", "title": "visual"}, {"color": "#97c2fc", "id": "chat", "label": "chat", "shape": "dot", "title": "chat"}, {"color": "#97c2fc", "id": "medical", "label": "medical", "shape": "dot", "title": "medical"}, {"color": "#97c2fc", "id": "alignment", "label": "alignment", "shape": "dot", "title": "alignment"}, {"color": "#97c2fc", "id": "tuning", "label": "tuning", "shape": "dot", "title": "tuning"}, {"color": "#97c2fc", "id": "epochs", "label": "epochs", "shape": "dot", "title": "epochs"}, {"color": "#97c2fc", "id": "samples", "label": "samples", "shape": "dot", "title": "samples"}, {"color": "#97c2fc", "id": "hours", "label": "hours", "shape": "dot", "title": "hours"}, {"color": "#97c2fc", "id": "downstrea", "label": "downstrea", "shape": "dot", "title": "downstrea"}, {"color": "#97c2fc", "id": "in HKGs", "label": "in HKGs", "shape": "dot", "title": "in HKGs"}, {"color": "#97c2fc", "id": "HKGs", "label": "HKGs", "shape": "dot", "title": "HKGs"}, {"color": "#97c2fc", "id": "medical concepts", "label": "medical concepts", "shape": "dot", "title": "medical concepts"}, {"color": "#97c2fc", "id": "medical literature", "label": "medical literature", "shape": "dot", "title": "medical literature"}, {"color": "#97c2fc", "id": "clinical trials", "label": "clinical trials", "shape": "dot", "title": "clinical trials"}, {"color": "#97c2fc", "id": "patientgenerated data", "label": "patientgenerated data", "shape": "dot", "title": "patientgenerated data"}, {"color": "#97c2fc", "id": "medical entities", "label": "medical entities", "shape": "dot", "title": "medical entities"}, {"color": "#97c2fc", "id": "relationships", "label": "relationships", "shape": "dot", "title": "relationships"}, {"color": "#97c2fc", "id": "to structured format", "label": "to structured format", "shape": "dot", "title": "to structured format"}, {"color": "#97c2fc", "id": "entities and relationships", "label": "entities and relationships", "shape": "dot", "title": "entities and relationships"}, {"color": "#97c2fc", "id": "to chosen ontologies", "label": "to chosen ontologies", "shape": "dot", "title": "to chosen ontologies"}, {"color": "#97c2fc", "id": "PubMed", "label": "PubMed", "shape": "dot", "title": "PubMed"}, {"color": "#97c2fc", "id": "navigational queries", "label": "navigational queries", "shape": "dot", "title": "navigational queries"}, {"color": "#97c2fc", "id": "Field Sensor", "label": "Field Sensor", "shape": "dot", "title": "Field Sensor"}, {"color": "#97c2fc", "id": "removed articles", "label": "removed articles", "shape": "dot", "title": "removed articles"}, {"color": "#97c2fc", "id": "articles without titles or abstracts", "label": "articles without titles or abstracts", "shape": "dot", "title": "articles without titles or abstracts"}, {"color": "#97c2fc", "id": "predictions", "label": "predictions", "shape": "dot", "title": "predictions"}, {"color": "#97c2fc", "id": "classification", "label": "classification", "shape": "dot", "title": "classification"}, {"color": "#97c2fc", "id": "framing", "label": "framing", "shape": "dot", "title": "framing"}, {"color": "#97c2fc", "id": "records", "label": "records", "shape": "dot", "title": "records"}, {"color": "#97c2fc", "id": "features", "label": "features", "shape": "dot", "title": "features"}, {"color": "#97c2fc", "id": "utilizing", "label": "utilizing", "shape": "dot", "title": "utilizing"}, {"color": "#97c2fc", "id": "new paradigm", "label": "new paradigm", "shape": "dot", "title": "new paradigm"}, {"color": "#97c2fc", "id": "NLEKMD", "label": "NLEKMD", "shape": "dot", "title": "NLEKMD"}, {"color": "#97c2fc", "id": "making", "label": "making", "shape": "dot", "title": "making"}, {"color": "#97c2fc", "id": "difficult", "label": "difficult", "shape": "dot", "title": "difficult"}, {"color": "#97c2fc", "id": "widely used", "label": "widely used", "shape": "dot", "title": "widely used"}, {"color": "#97c2fc", "id": "decision", "label": "decision", "shape": "dot", "title": "decision"}, {"color": "#97c2fc", "id": "clinicians", "label": "clinicians", "shape": "dot", "title": "clinicians"}, {"color": "#97c2fc", "id": "remote", "label": "remote", "shape": "dot", "title": "remote"}]);
92
- edges = new vis.DataSet([{"from": "TKM", "title": "is", "to": "decision-making"}, {"from": "TKM", "title": "is", "to": "semantic web"}, {"from": "TKM", "title": "is", "to": "ontologies"}, {"from": "TKM", "title": "implicit", "to": "data"}, {"from": "TKM", "title": "limitation", "to": "deep learning models"}, {"from": "TKM", "title": "shortage", "to": "patient outcomes prediction"}, {"from": "TKM", "title": "imbalance", "to": "post-discharge readmissions"}, {"from": "TKM", "title": "contains", "to": "information"}, {"from": "TKM", "title": "mix", "to": "tabular and unstructured"}, {"from": "TKM", "title": "and", "to": "enrich"}, {"from": "TKM", "title": "tokenized using", "to": "BERT base tokenizer"}, {"from": "TKM", "title": "IOB tagging scheme", "to": "BERT variant models"}, {"from": "TKM", "title": "CRF layer as tag encoding", "to": "BERT variants in medical domain"}, {"from": "TKM", "title": "augmentation", "to": "approach"}, {"from": "TKM", "title": "statistics", "to": "biomedical"}, {"from": "TKM", "title": "statistics", "to": "multimodal"}, {"from": "TKM", "title": "statistics", "to": "instruction"}, {"from": "TKM", "title": "statistics", "to": "responses"}, {"from": "TKM", "title": "statistics", "to": "visual"}, {"from": "TKM", "title": "statistics", "to": "chat"}, {"from": "TKM", "title": "statistics", "to": "medical"}, {"from": "TKM", "title": "statistics", "to": "alignment"}, {"from": "TKM", "title": "statistics", "to": "tuning"}, {"from": "TKM", "title": "statistics", "to": "epochs"}, {"from": "TKM", "title": "statistics", "to": "samples"}, {"from": "TKM", "title": "statistics", "to": "hours"}, {"from": "TKM", "title": "statistics", "to": "downstrea"}, {"from": "TKM", "title": "heterogeneity", "to": "in HKGs"}, {"from": "TKM", "title": "in", "to": "HKGs"}, {"from": "TKM", "title": "in", "to": "medical concepts"}, {"from": "TKM", "title": "gather", "to": "medical literature"}, {"from": "TKM", "title": "gather", "to": "clinical trials"}, {"from": "TKM", "title": "gather", "to": "patientgenerated data"}, {"from": "TKM", "title": "extract", "to": "medical entities"}, {"from": "TKM", "title": "extract", "to": "relationships"}, {"from": "TKM", "title": "transform", "to": "to structured format"}, {"from": "TKM", "title": "map", "to": "entities and relationships"}, {"from": "TKM", "title": "map", "to": "to chosen ontologies"}, {"from": "TKM", "title": "collection", "to": "PubMed"}, {"from": "TKM", "title": "collection", "to": "navigational queries"}, {"from": "TKM", "title": "collection", "to": "Field Sensor"}, {"from": "TKM", "title": "collection", "to": "removed articles"}, {"from": "TKM", "title": "collection", "to": "articles without titles or abstracts"}, {"from": "TKM", "title": "patterns", "to": "predictions"}, {"from": "TKM", "title": "algorithms", "to": "classification"}, {"from": "TKM", "title": "problem", "to": "framing"}, {"from": "TKM", "title": "medical", "to": "records"}, {"from": "TKM", "title": "key", "to": "features"}, {"from": "TKM", "title": "models", "to": "utilizing"}, {"from": "TKM", "title": "could benefit from", "to": "new paradigm"}, {"from": "TKM", "title": "near-passing performance", "to": "NLEKMD"}, {"from": "making", "title": "it", "to": "difficult"}, {"from": "making", "title": "valuable", "to": "widely used"}, {"from": "clinicians", "title": "local", "to": "remote"}]);
93
 
94
  nodeColors = {};
95
  allNodes = nodes.get({ returnType: "Object" });
 
88
 
89
 
90
  // parsing and collecting nodes and edges from the python
91
+ nodes = new vis.DataSet([{"color": "#97c2fc", "id": "help", "label": "help", "shape": "dot", "title": "help"}, {"color": "#97c2fc", "id": "KEYWORDS", "label": "KEYWORDS", "shape": "dot", "title": "KEYWORDS"}, {"color": "#97c2fc", "id": "following", "label": "following", "shape": "dot", "title": "following"}, {"color": "#97c2fc", "id": "could", "label": "could", "shape": "dot", "title": "could"}, {"color": "#97c2fc", "id": "sentences", "label": "sentences", "shape": "dot", "title": "sentences"}, {"color": "#97c2fc", "id": "What systems could help with the following sentences?\n\nKEYWORDS: systems", "label": "What systems could help with the following sentences?\n\nKEYWORDS: systems", "shape": "dot", "title": "What systems could help with the following sentences?\n\nKEYWORDS: systems"}, {"color": "#97c2fc", "id": "systems", "label": "systems", "shape": "dot", "title": "systems"}, {"color": "#97c2fc", "id": "to shared task leaderboard", "label": "to shared task leaderboard", "shape": "dot", "title": "to shared task leaderboard"}, {"color": "#97c2fc", "id": "What", "label": "What", "shape": "dot", "title": "What"}, {"color": "#97c2fc", "id": "the capital of France", "label": "the capital of France", "shape": "dot", "title": "the capital of France"}, {"color": "#97c2fc", "id": "the capital", "label": "the capital", "shape": "dot", "title": "the capital"}, {"color": "#97c2fc", "id": "Alice", "label": "Alice", "shape": "dot", "title": "Alice"}, {"color": "#97c2fc", "id": "Bob", "label": "Bob", "shape": "dot", "title": "Bob"}, {"color": "#97c2fc", "id": "Carol", "label": "Carol", "shape": "dot", "title": "Carol"}, {"color": "#97c2fc", "id": "David", "label": "David", "shape": "dot", "title": "David"}, {"color": "#97c2fc", "id": "Jane", "label": "Jane", "shape": "dot", "title": "Jane"}, {"color": "#97c2fc", "id": "Peter", "label": "Peter", "shape": "dot", "title": "Peter"}, {"color": "#97c2fc", "id": "Sarah", "label": "Sarah", "shape": "dot", "title": "Sarah"}, {"color": "#97c2fc", "id": "Tom", "label": "Tom", "shape": "dot", "title": "Tom"}, {"color": "#97c2fc", "id": "William", "label": "William", "shape": "dot", "title": "William"}, {"color": "#97c2fc", "id": "Yolanda", "label": "Yolanda", "shape": "dot", "title": "Yolanda"}, {"color": "#97c2fc", "id": "Zane", "label": "Zane", "shape": "dot", "title": "Zane"}, {"color": "#97c2fc", "id": "Charlie", "label": "Charlie", "shape": "dot", "title": "Charlie"}, {"color": "#97c2fc", "id": "Sara", "label": "Sara", "shape": "dot", "title": "Sara"}, {"color": "#97c2fc", "id": "mother of", "label": "mother of", "shape": "dot", "title": "mother of"}, {"color": "#97c2fc", "id": "wife of", "label": "wife of", "shape": "dot", "title": "wife of"}, {"color": "#97c2fc", "id": "daughter of", "label": "daughter of", "shape": "dot", "title": "daughter of"}, {"color": "#97c2fc", "id": "Sam", "label": "Sam", "shape": "dot", "title": "Sam"}, {"color": "#97c2fc", "id": "Susan", "label": "Susan", "shape": "dot", "title": "Susan"}, {"color": "#97c2fc", "id": "Zara", "label": "Zara", "shape": "dot", "title": "Zara"}, {"color": "#97c2fc", "id": "Wendy", "label": "Wendy", "shape": "dot", "title": "Wendy"}, {"color": "#97c2fc", "id": "Davi", "label": "Davi", "shape": "dot", "title": "Davi"}, {"color": "#97c2fc", "id": "Caro", "label": "Caro", "shape": "dot", "title": "Caro"}, {"color": "#97c2fc", "id": "John", "label": "John", "shape": "dot", "title": "John"}, {"color": "#97c2fc", "id": "Mary", "label": "Mary", "shape": "dot", "title": "Mary"}, {"color": "#97c2fc", "id": "granddaughter of", "label": "granddaughter of", "shape": "dot", "title": "granddaughter of"}, {"color": "#97c2fc", "id": "niece of", "label": "niece of", "shape": "dot", "title": "niece of"}, {"color": "#97c2fc", "id": "nephew of", "label": "nephew of", "shape": "dot", "title": "nephew of"}, {"color": "#97c2fc", "id": "George", "label": "George", "shape": "dot", "title": "George"}, {"color": "#97c2fc", "id": "Bill", "label": "Bill", "shape": "dot", "title": "Bill"}, {"color": "#97c2fc", "id": "Emily", "label": "Emily", "shape": "dot", "title": "Emily"}, {"color": "#97c2fc", "id": "Charlie and Jane", "label": "Charlie and Jane", "shape": "dot", "title": "Charlie and Jane"}, {"color": "#97c2fc", "id": "Jane and Charlie", "label": "Jane and Charlie", "shape": "dot", "title": "Jane and Charlie"}, {"color": "#97c2fc", "id": "Jan", "label": "Jan", "shape": "dot", "title": "Jan"}, {"color": "#97c2fc", "id": "is being prescribed Lipitor for treatment", "label": "is being prescribed Lipitor for treatment", "shape": "dot", "title": "is being prescribed Lipitor for treatment"}, {"color": "#97c2fc", "id": "0.8", "label": "0.8", "shape": "dot", "title": "0.8"}, {"color": "#97c2fc", "id": "Greg", "label": "Greg", "shape": "dot", "title": "Greg"}, {"color": "#97c2fc", "id": "Jennifer", "label": "Jennifer", "shape": "dot", "title": "Jennifer"}, {"color": "#97c2fc", "id": "Mark", "label": "Mark", "shape": "dot", "title": "Mark"}, {"color": "#97c2fc", "id": "father of Charlie", "label": "father of Charlie", "shape": "dot", "title": "father of Charlie"}, {"color": "#97c2fc", "id": "Jack", "label": "Jack", "shape": "dot", "title": "Jack"}, {"color": "#97c2fc", "id": "Kevin", "label": "Kevin", "shape": "dot", "title": "Kevin"}, {"color": "#97c2fc", "id": "Lisa", "label": "Lisa", "shape": "dot", "title": "Lisa"}, {"color": "#97c2fc", "id": "Tim", "label": "Tim", "shape": "dot", "title": "Tim"}, {"color": "#97c2fc", "id": "HIV", "label": "HIV", "shape": "dot", "title": "HIV"}, {"color": "#97c2fc", "id": "flu", "label": "flu", "shape": "dot", "title": "flu"}, {"color": "#97c2fc", "id": "HIV and flu", "label": "HIV and flu", "shape": "dot", "title": "HIV and flu"}, {"color": "#97c2fc", "id": "mother of Alice", "label": "mother of Alice", "shape": "dot", "title": "mother of Alice"}]);
92
+ edges = new vis.DataSet([{"from": "systems", "title": "submitted", "to": "to shared task leaderboard"}, {"from": "What", "title": "is", "to": "the capital of France"}, {"from": "What", "title": "is", "to": "the capital"}, {"from": "What", "title": "is your name?", "to": "Alice"}, {"from": "What", "title": "is mother of", "to": "Bob"}, {"from": "What", "title": "is father of", "to": "Carol"}, {"from": "What", "title": "is father of", "to": "David"}, {"from": "What", "title": "is father of", "to": "Jane"}, {"from": "What", "title": "is father of", "to": "Peter"}, {"from": "What", "title": "is father of", "to": "Sarah"}, {"from": "What", "title": "is father of", "to": "Tom"}, {"from": "What", "title": "is father of", "to": "William"}, {"from": "What", "title": "is father of", "to": "Yolanda"}, {"from": "What", "title": "is father of", "to": "Zane"}, {"from": "What", "title": "is father of", "to": "Charlie"}, {"from": "What", "title": "is mother of", "to": "Sara"}, {"from": "What", "title": "is", "to": "mother of"}, {"from": "What", "title": "is", "to": "wife of"}, {"from": "What", "title": "is", "to": "daughter of"}, {"from": "What", "title": "is father of", "to": "Sam"}, {"from": "What", "title": "is father of", "to": "Susan"}, {"from": "What", "title": "is father of", "to": "Zara"}, {"from": "What", "title": "is father of", "to": "Wendy"}, {"from": "What", "title": "is father of", "to": "Davi"}, {"from": "What", "title": "is father of", "to": "Caro"}, {"from": "What", "title": "is father of", "to": "John"}, {"from": "What", "title": "is father of", "to": "Mary"}, {"from": "What", "title": "is", "to": "granddaughter of"}, {"from": "What", "title": "is", "to": "niece of"}, {"from": "What", "title": "is", "to": "nephew of"}, {"from": "What", "title": "is brother of", "to": "George"}, {"from": "What", "title": "is wife of", "to": "Bill"}, {"from": "What", "title": "is daughter of", "to": "Emily"}, {"from": "What", "title": "is mother of", "to": "Charlie and Jane"}, {"from": "What", "title": "is father of", "to": "Jane and Charlie"}, {"from": "What", "title": "is mother of", "to": "Jan"}, {"from": "What", "title": "has hyperlipidmia", "to": "is being prescribed Lipitor for treatment"}, {"from": "What", "title": "0.8", "to": "0.8"}, {"from": "What", "title": "is mother of", "to": "Greg"}, {"from": "What", "title": "is father of", "to": "Jennifer"}, {"from": "What", "title": "is father of", "to": "Mark"}, {"from": "What", "title": "is", "to": "father of Charlie"}, {"from": "What", "title": "is father of", "to": "Jack"}, {"from": "What", "title": "is father of", "to": "Kevin"}, {"from": "What", "title": "is father of", "to": "Lisa"}, {"from": "What", "title": "is father of", "to": "Tim"}, {"from": "What", "title": "has", "to": "HIV"}, {"from": "What", "title": "has", "to": "flu"}, {"from": "What", "title": "has", "to": "HIV and flu"}, {"from": "What", "title": "is", "to": "mother of Alice"}]);
93
 
94
  nodeColors = {};
95
  allNodes = nodes.get({ returnType: "Object" });