anonymous5378 commited on
Commit
701073c
·
verified ·
1 Parent(s): 1a5d3d1

Fix format issue

Browse files
Files changed (1) hide show
  1. language_model.py +8 -5
language_model.py CHANGED
@@ -165,10 +165,13 @@ class TransformersAVG:
165
  def __format_av(self, predictions: str, splitting_symbol: str = '|') -> list:
166
  my_list = []
167
  for raw_string in predictions.split(splitting_symbol):
168
- a = raw_string.replace('attribute: ', '')
169
- a = a.split(',')[0].strip()
170
- v = raw_string.replace('value: ', '')
171
- v = v.split(',')[1].strip()
172
- my_list.append((a,v))
 
 
 
173
 
174
  return my_list
 
165
  def __format_av(self, predictions: str, splitting_symbol: str = '|') -> list:
166
  my_list = []
167
  for raw_string in predictions.split(splitting_symbol):
168
+ try:
169
+ a = raw_string.replace('attribute: ', '')
170
+ a = a.split(',')[0].strip()
171
+ v = raw_string.replace('value: ', '')
172
+ v = v.split(',')[1].strip()
173
+ my_list.append((a,v))
174
+ except:
175
+ pass
176
 
177
  return my_list