Liusuthu commited on
Commit
792e702
·
verified ·
1 Parent(s): 6b2f58c

Update app_utils.py

Browse files
Files changed (1) hide show
  1. app_utils.py +10 -1
app_utils.py CHANGED
@@ -44,6 +44,15 @@ def text_api(text:str):
44
  )
45
  return result
46
 
 
 
 
 
 
 
 
 
 
47
 
48
  def classify_continuous(audio):
49
  print(type(audio))
@@ -437,7 +446,7 @@ def video_test(video):
437
  print(prob2,label,path)
438
  print("score2=",score2)
439
 
440
- text_result=text_api(text)
441
  print(text_result)
442
 
443
 
 
44
  )
45
  return result
46
 
47
+ def get_text_score(text):
48
+ part1 = str.partition(string, r"text")
49
+ want1 = part1[2]
50
+ label = want1[4:6]
51
+ part2 = str.partition(string, r"probability")
52
+ want2 = part2[2]
53
+ prob = float(want2[3:-4])
54
+ return label, prob
55
+
56
 
57
  def classify_continuous(audio):
58
  print(type(audio))
 
446
  print(prob2,label,path)
447
  print("score2=",score2)
448
 
449
+ text_result=str(get_text_score(text_api(text)))
450
  print(text_result)
451
 
452