MCPcopy
hub / github.com/mlfoundations/open_flamingo / processPunctuation

Method processPunctuation

open_flamingo/eval/vqa_metric.py:449–459  ·  view source on GitHub ↗
(self, inText)

Source from the content-addressed store, hash-verified

447 print("Done computing accuracy")
448
449 def processPunctuation(self, inText):
450 outText = inText
451 for p in self.punct:
452 if (p + " " in inText or " " + p in inText) or (
453 re.search(self.commaStrip, inText) != None
454 ):
455 outText = outText.replace(p, "")
456 else:
457 outText = outText.replace(p, " ")
458 outText = self.periodStrip.sub("", outText, re.UNICODE)
459 return outText
460
461 def processDigitArticle(self, inText):
462 outText = []

Callers 3

evaluateMethod · 0.95
fill_vizwiz_test_jsonFunction · 0.80
fill_vqav2_test_jsonFunction · 0.80

Calls

no outgoing calls

Tested by 2

fill_vizwiz_test_jsonFunction · 0.64
fill_vqav2_test_jsonFunction · 0.64