lfoppiano commited on
Commit
53ab843
·
1 Parent(s): 8913fe2

update streamlit, add dotted border with the most relevant item

Browse files
document_qa/grobid_processors.py CHANGED
@@ -554,18 +554,21 @@ class GrobidAggregationProcessor(GrobidQuantitiesProcessor, GrobidMaterialsProce
554
  return []
555
 
556
  @staticmethod
557
- def box_to_dict(box, color=None, type=None):
558
 
559
  if box is None or box == "" or len(box) < 5:
560
  return {}
561
 
562
  item = {"page": box[0], "x": box[1], "y": box[2], "width": box[3], "height": box[4]}
563
- if color is not None:
564
  item['color'] = color
565
 
566
  if type:
567
  item['type'] = type
568
 
 
 
 
569
  return item
570
 
571
  @staticmethod
 
554
  return []
555
 
556
  @staticmethod
557
+ def box_to_dict(box, color=None, type=None, border=None):
558
 
559
  if box is None or box == "" or len(box) < 5:
560
  return {}
561
 
562
  item = {"page": box[0], "x": box[1], "y": box[2], "width": box[3], "height": box[4]}
563
+ if color:
564
  item['color'] = color
565
 
566
  if type:
567
  item['type'] = type
568
 
569
+ if border:
570
+ item['border'] = border
571
+
572
  return item
573
 
574
  @staticmethod
requirements.txt CHANGED
@@ -27,6 +27,6 @@ typing-inspect==0.9.0
27
  typing_extensions==4.11.0
28
  pydantic==2.6.4
29
  sentence_transformers==2.6.1
30
- streamlit-pdf-viewer==0.0.21
31
  umap-learn
32
  plotly
 
27
  typing_extensions==4.11.0
28
  pydantic==2.6.4
29
  sentence_transformers==2.6.1
30
+ streamlit-pdf-viewer==0.0.22
31
  umap-learn
32
  plotly
streamlit_app.py CHANGED
@@ -470,6 +470,9 @@ with right_column:
470
  for i, color in enumerate(gradients):
471
  for annotation in annotations[i]:
472
  annotation['color'] = color
 
 
 
473
  st.session_state['annotations'] = [annotation for annotation_doc in annotations for annotation in
474
  annotation_doc]
475
 
 
470
  for i, color in enumerate(gradients):
471
  for annotation in annotations[i]:
472
  annotation['color'] = color
473
+ if i == 0:
474
+ annotation['border'] = "dotted"
475
+
476
  st.session_state['annotations'] = [annotation for annotation_doc in annotations for annotation in
477
  annotation_doc]
478