thomas0809 commited on
Commit
a677d37
1 Parent(s): c157f5a

change markdown

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -23,7 +23,7 @@ def get_markdown(reaction):
23
  s = ''
24
  for ent in reaction[x]:
25
  if 'smiles' in ent:
26
- s += ent['smiles'] + '<br>'
27
  elif 'text' in ent:
28
  s += ' '.join(ent['text']) + '<br>'
29
  else:
@@ -46,11 +46,11 @@ with gr.Blocks() as demo:
46
  Extract chemical reactions from a diagram. Please upload a reaction diagram, RxnScribe will predict the reaction structures in the diagram.
47
 
48
  The predicted reactions are visualized in separate images.
49
- <span style="color:red">**Red** boxes are <ins>*reactants*</ins>.</span>
50
- <span style="color:green">**Green** boxes are <ins>*reaction conditions*</ins>.</span>
51
- <span style="color:blue">**Blue** boxes are <ins>*products*</ins>.</span>
52
 
53
- It usually takes 10-20 seconds to process a diagram with this demo.
54
  Check the options to run [MolScribe](https://huggingface.co/spaces/yujieq/MolScribe) and [OCR](https://huggingface.co/spaces/tomofi/EasyOCR) (it will take a longer time, of course).
55
 
56
  Code: https://github.com/thomas0809/RxnScribe
@@ -65,7 +65,7 @@ with gr.Blocks() as demo:
65
  ocr = gr.Checkbox(label="Run OCR to recognize text")
66
  btn = gr.Button("Submit").style(full_width=False)
67
  with gr.Row():
68
- gallery = gr.Image(label='Predicted reactions', show_label=True).style(height='auto')
69
  markdown = gr.Dataframe(
70
  headers=['#', 'reactant', 'condition', 'product'],
71
  datatype=['number'] + ['markdown'] * 3,
 
23
  s = ''
24
  for ent in reaction[x]:
25
  if 'smiles' in ent:
26
+ s += "\n```\n" + ent['smiles'] + "\n```\n"
27
  elif 'text' in ent:
28
  s += ' '.join(ent['text']) + '<br>'
29
  else:
 
46
  Extract chemical reactions from a diagram. Please upload a reaction diagram, RxnScribe will predict the reaction structures in the diagram.
47
 
48
  The predicted reactions are visualized in separate images.
49
+ <b style="color:red">Red boxes are <ins><em>reactants</em></ins>.</b>
50
+ <b style="color:green">Green boxes are <ins><em>reaction conditions</em></ins>.</b>
51
+ <b style="color:blue">Blue boxes are <ins><em>products</em></ins>.</b>
52
 
53
+ It usually takes 5-10 seconds to process a diagram with this demo.
54
  Check the options to run [MolScribe](https://huggingface.co/spaces/yujieq/MolScribe) and [OCR](https://huggingface.co/spaces/tomofi/EasyOCR) (it will take a longer time, of course).
55
 
56
  Code: https://github.com/thomas0809/RxnScribe
 
65
  ocr = gr.Checkbox(label="Run OCR to recognize text")
66
  btn = gr.Button("Submit").style(full_width=False)
67
  with gr.Row():
68
+ gallery = gr.Image(label='Predicted reactions', show_label=True).style(height="auto")
69
  markdown = gr.Dataframe(
70
  headers=['#', 'reactant', 'condition', 'product'],
71
  datatype=['number'] + ['markdown'] * 3,