MCPcopy Create free account
hub / github.com/FunAudioLLM/SenseVoice / format_str_v2

Function format_str_v2

webui.py:97–114  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

95
96
97def format_str_v2(s):
98 sptk_dict = {}
99 for sptk in emoji_dict:
100 sptk_dict[sptk] = s.count(sptk)
101 s = s.replace(sptk, "")
102 emo = "<|NEUTRAL|>"
103 for e in emo_dict:
104 if sptk_dict[e] > sptk_dict[emo]:
105 emo = e
106 for e in event_dict:
107 if sptk_dict[e] > 0:
108 s = event_dict[e] + s
109 s = s + emo_dict[emo]
110
111 for emoji in emo_set.union(event_set):
112 s = s.replace(" " + emoji, emoji)
113 s = s.replace(emoji + " ", emoji)
114 return s.strip()
115
116def format_str_v3(s):
117 def get_emo(s):

Callers 1

format_str_v3Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected