GameSentenceMiner 2.15.6__py3-none-any.whl → 2.15.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
GameSentenceMiner/vad.py CHANGED
@@ -189,9 +189,10 @@ class WhisperVADProcessor(VADProcessor):
189
189
  temperature=0.0)
190
190
  voice_activity = []
191
191
 
192
- logger.debug(json.dumps(result.to_dict(), indent=2))
192
+ logger.debug(json.dumps(result.to_dict()))
193
193
 
194
194
  # Process the segments to extract tokens, timestamps, and confidence
195
+ previous_segment = None
195
196
  for i, segment in enumerate(result.segments):
196
197
  if len(segment.text) <= 2 and ((i > 1 and segment.start - result.segments[i - 1].end > 1.0) or (i < len(result.segments) - 1 and result.segments[i + 1].start - segment.end > 1.0)):
197
198
  if segment.text in ['えー', 'ん']:
@@ -201,10 +202,18 @@ class WhisperVADProcessor(VADProcessor):
201
202
  logger.info(
202
203
  "Unknown single character segment, not skipping, but logging, please report if this is a mistake: " + segment.text)
203
204
 
204
- if segment.no_speech_prob and segment.no_speech_prob > 0.8:
205
+ if segment.no_speech_prob and segment.no_speech_prob > 0.6:
205
206
  logger.debug(f"Skipping segment with high no_speech_prob: {segment.no_speech_prob} for segment {segment.text} at {segment.start}-{segment.end}")
206
207
  continue
207
-
208
+
209
+ unique_words = set(word['text'] for word in segment.words)
210
+ if len(unique_words) <= 1 and len(segment.words) > 1:
211
+ logger.debug(f"Skipping segment with low unique words: {unique_words} for segment {segment.text} at {segment.start}-{segment.end}")
212
+ continue
213
+
214
+ if previous_segment and segment.start - previous_segment.end > 5 and segment.no_speech_prob > .3:
215
+ logger.debug(f"Skipping segment after long pause with high no_speech_prob after: {segment.no_speech_prob} for segment {segment.text} at {segment.start}-{segment.end}")
216
+ continue
208
217
 
209
218
  logger.debug(segment.to_dict())
210
219
  voice_activity.append({
@@ -225,15 +234,7 @@ class WhisperVADProcessor(VADProcessor):
225
234
  # 'confidence': word.probability
226
235
  # })
227
236
 
228
- # Analyze the detected words to decide whether to use the audio
229
- should_use = False
230
- unique_words = set(word['text'] for word in voice_activity)
231
- if len(unique_words) > 1 or not all(item in ['えー', 'ん'] for item in unique_words):
232
- should_use = True
233
-
234
- if not should_use:
235
- return None
236
-
237
+ previous_segment = segment
237
238
  # Return the detected voice activity and the total duration
238
239
  return voice_activity
239
240
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.15.6
3
+ Version: 2.15.8
4
4
  Summary: A tool for mining sentences from games. Update: Overlay?
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ GameSentenceMiner/config_gui.py,sha256=i79PrY2pP8_VKvIL7uoDv5cgHvCCQBIe0mS_YnX2A
4
4
  GameSentenceMiner/gametext.py,sha256=fgBgLchezpauWELE9Y5G3kVCLfAneD0X4lJFoI3FYbs,10351
5
5
  GameSentenceMiner/gsm.py,sha256=t2GAhMwVEHUzCdqM4tIgAzBUvNmt_Gec515iePacD6k,31945
6
6
  GameSentenceMiner/obs.py,sha256=EyAYhaLvMjoeC-3j7fuvkqZN5logFFanPfb8Wn1C6m0,27296
7
- GameSentenceMiner/vad.py,sha256=VPYXFq0wnj1rzhZjFXDyTVQYHOSQaoap3tH-lMA-CTA,19821
7
+ GameSentenceMiner/vad.py,sha256=BqwvKF0lRB_ys1On_Ua1vvimUFmkHO-D9gBbCkaBaxc,20193
8
8
  GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  GameSentenceMiner/ai/ai_prompting.py,sha256=41xdBzE88Jlt12A0D-T_cMfLO5j6MSxfniOptpwNZm0,24068
10
10
  GameSentenceMiner/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -72,9 +72,9 @@ GameSentenceMiner/web/templates/index.html,sha256=LqXZx7-NE42pXSpHNZ3To680rD-vt9
72
72
  GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
73
73
  GameSentenceMiner/web/templates/utility.html,sha256=3flZinKNqUJ7pvrZk6xu__v67z44rXnaK7UTZ303R-8,16946
74
74
  GameSentenceMiner/wip/__init___.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
- gamesentenceminer-2.15.6.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
76
- gamesentenceminer-2.15.6.dist-info/METADATA,sha256=_UoXIP7jWBvF4lpRp2OLNOhGUpTAXG2cnUKXmbKepyw,7348
77
- gamesentenceminer-2.15.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
78
- gamesentenceminer-2.15.6.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
79
- gamesentenceminer-2.15.6.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
80
- gamesentenceminer-2.15.6.dist-info/RECORD,,
75
+ gamesentenceminer-2.15.8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
76
+ gamesentenceminer-2.15.8.dist-info/METADATA,sha256=bXBIX71jQ-PLrLVxpjrANJmu_ET8bA0EjRbgbgBl-AM,7348
77
+ gamesentenceminer-2.15.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
78
+ gamesentenceminer-2.15.8.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
79
+ gamesentenceminer-2.15.8.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
80
+ gamesentenceminer-2.15.8.dist-info/RECORD,,