Pclanglais commited on
Commit
8e58d65
·
verified ·
1 Parent(s): b0fe837

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -175,13 +175,14 @@ class CombinedProcessor:
175
  bibliography_entries = editorial_df[editorial_df['entity_group'] == 'bibliography']['word'].tolist()
176
 
177
  bibtex_entries = []
178
-
 
179
  for entry in bibliography_entries:
180
  print(entry)
181
  entry = re.sub(r'- ?[\n¶] ?', r'', entry)
182
  entry = re.sub(r' ?[\n¶] ?', r' ', entry)
183
- style = style_classifier(entry, truncation=True, padding=True, top_k=10)
184
- print(style)
185
  entry = re.sub(r'\s*([;:,\.])\s*', r' \1 ', entry)
186
  #print(entry)
187
  bib_out = bibliography_classifier(entry)
@@ -208,6 +209,8 @@ class CombinedProcessor:
208
  bibtex_entry = create_bibtex_entry(bibtex_data)
209
  bibtex_entries.append(bibtex_entry)
210
 
 
 
211
  #Disambiguation to avoid duplicate ids.
212
  bibtex_entries = disambiguate_bibtex_ids(bibtex_entries)
213
 
 
175
  bibliography_entries = editorial_df[editorial_df['entity_group'] == 'bibliography']['word'].tolist()
176
 
177
  bibtex_entries = []
178
+ list_style = []
179
+
180
  for entry in bibliography_entries:
181
  print(entry)
182
  entry = re.sub(r'- ?[\n¶] ?', r'', entry)
183
  entry = re.sub(r' ?[\n¶] ?', r' ', entry)
184
+ style = pd.DataFrame(style_classifier(entry, truncation=True, padding=True, top_k=1))
185
+ list_style.append(style)
186
  entry = re.sub(r'\s*([;:,\.])\s*', r' \1 ', entry)
187
  #print(entry)
188
  bib_out = bibliography_classifier(entry)
 
209
  bibtex_entry = create_bibtex_entry(bibtex_data)
210
  bibtex_entries.append(bibtex_entry)
211
 
212
+ list_style = pd.concat(list_style)
213
+ print(list_style)
214
  #Disambiguation to avoid duplicate ids.
215
  bibtex_entries = disambiguate_bibtex_ids(bibtex_entries)
216