lyrics-transcriber 0.12.8__py3-none-any.whl → 0.12.9__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.
@@ -1,39 +1,61 @@
1
1
  # This configuration runs each prompt through a series of example inputs and checks if they meet requirements.
2
2
  # Learn more: https://promptfoo.dev/docs/configuration/guide
3
3
 
4
+ description: Song lyric corrector for a karaoke video studio, responsible for reading lyrics inputs, correcting them and generating JSON-based responses containing the corrected lyrics according to predefined criteria.
5
+ providers:
6
+ - id: openai:gpt-3.5-turbo-1106
7
+ config:
8
+ temperature: 0
9
+ # - id: openai:gpt-4-1106-preview
10
+ # config:
11
+ # temperature: 0
4
12
  prompts:
5
- - file://llm_prompt_lyrics_correction_*.txt
6
- providers: [openai:gpt-3.5-turbo-0613, openai:gpt-4-1106-preview]
13
+ - file://llm_prompt_lyrics_correction_andrew_handwritten_20231118.txt
14
+
15
+ defaultTest:
16
+ assert:
17
+ - type: is-json
18
+ value:
19
+ required: [id, text, words]
20
+ type: object
21
+ properties:
22
+ id:
23
+ type: number
24
+ text:
25
+ type: string
26
+ words:
27
+ type: array
28
+ items:
29
+ type: object
30
+ properties:
31
+ text:
32
+ type: string
33
+ start:
34
+ type: number
35
+ end:
36
+ type: number
37
+ confidence:
38
+ type: number
39
+
7
40
  tests:
8
- - description: First test case - automatic review
41
+ - description: ABBA - Under Attack (segment 0)
9
42
  vars:
10
- var1: first variable's value
11
- var2: another value
12
- var3: some other value
13
- # For more information on assertions, see https://promptfoo.dev/docs/configuration/expected-outputs
43
+ reference_lyrics: file://test_data/ABBA-UnderAttack-Genius.txt
44
+ previous_two_corrected_lines:
45
+ upcoming_two_uncorrected_lines:
46
+ segment_input: |
47
+ {"id": 0, "start": 17.46, "end": 21.3, "confidence": 0.792, "text": " Don't know how to take it, don't know where to go", "words": [{"text": "Don't", "start": 17.46, "end": 18.2, "confidence": 0.278}, {"text": "know", "start": 18.2, "end": 18.42, "confidence": 0.965}, {"text": "how", "start": 18.42, "end": 18.66, "confidence": 0.865}, {"text": "to", "start": 18.66, "end": 18.88, "confidence": 0.994}, {"text": "take", "start": 18.88, "end": 19.2, "confidence": 0.992}, {"text": "it,", "start": 19.2, "end": 19.44, "confidence": 0.974}, {"text": "don't", "start": 19.56, "end": 19.8, "confidence": 0.917}, {"text": "know", "start": 19.8, "end": 20.02, "confidence": 0.989}, {"text": "where", "start": 20.02, "end": 20.46, "confidence": 0.963}, {"text": "to", "start": 20.46, "end": 20.76, "confidence": 0.983}, {"text": "go", "start": 20.76, "end": 21.3, "confidence": 0.982}]}
14
48
  assert:
15
- - type: equals
16
- value: expected LLM output goes here
17
49
  - type: contains
18
- value: some text
19
- - type: javascript
20
- value: 1 / (output.length + 1) # prefer shorter outputs
50
+ value: "Don't know how to take it, don't know where to go"
21
51
 
22
- - description: Second test case - manual review
23
- # Test cases don't need assertions if you prefer to manually review the output
52
+ - description: ABBA - Under Attack (segment 1)
24
53
  vars:
25
- var1: new value
26
- var2: another value
27
- var3: third value
28
-
29
- - description: Third test case - other types of automatic review
30
- vars:
31
- var1: yet another value
32
- var2: and another
33
- var3: dear llm, please output your response in json format
54
+ reference_lyrics: file://test_data/ABBA-UnderAttack-Genius.txt
55
+ previous_two_corrected_lines:
56
+ upcoming_two_uncorrected_lines:
57
+ segment_input: |
58
+ {"id": 1, "start": 22.04, "end": 27.84, "confidence": 0.763, "text": " My resistance running low And every day the hole is getting tighter", "words": [{"text": "My", "start": 22.04, "end": 22.32, "confidence": 0.535}, {"text": "resistance", "start": 22.32, "end": 22.94, "confidence": 0.936}, {"text": "running", "start": 22.94, "end": 23.66, "confidence": 0.89}, {"text": "low", "start": 23.66, "end": 24.36, "confidence": 0.999}, {"text": "And", "start": 24.36, "end": 25.14, "confidence": 0.485}, {"text": "every", "start": 25.14, "end": 25.56, "confidence": 0.568}, {"text": "day", "start": 25.56, "end": 25.88, "confidence": 0.997}, {"text": "the", "start": 25.88, "end": 26.1, "confidence": 0.959}, {"text": "hole", "start": 26.1, "end": 26.48, "confidence": 0.361}, {"text": "is", "start": 26.48, "end": 26.68, "confidence": 0.947}, {"text": "getting", "start": 26.68, "end": 27.08, "confidence": 0.996}, {"text": "tighter", "start": 27.08, "end": 27.84, "confidence": 0.975}]}
34
59
  assert:
35
- - type: contains-json
36
- - type: similar
37
- value: ensures that output is semantically similar to this text
38
- - type: model-graded-closedqa
39
- value: ensure that output contains a reference to X
60
+ - type: contains
61
+ value: "My resistance running low And every day the hold is getting tighter"
@@ -0,0 +1,48 @@
1
+ Don't know how to take it, don't know where to go
2
+ My resistance running low
3
+ And every day the hold is getting tighter and it troubles me so
4
+ (You know that I'm nobody's fool)
5
+ I'm nobody's fool and yet it's clear to me
6
+ I don't have a strategy
7
+ It's just like taking candy from a baby and I think I must be
8
+
9
+ Under attack, I'm being taken
10
+ About to crack, defences breaking
11
+ Won't somebody please have a heart
12
+ Come and rescue me now 'cause I'm falling apart
13
+ Under attack, I'm taking cover
14
+ He's on my track, my chasing lover
15
+ Thinking nothing can stop him now
16
+ Should I want to, I'm not sure I would know how
17
+
18
+ This is getting crazy, I should tell him so
19
+ Really let my anger show
20
+ Persuade him that the answer to his questions is a definite no
21
+ (I'm kind of flattered I suppose)
22
+ Guess I'm kind of flattered but I'm scared as well
23
+ Something like a magic spell
24
+ I hardly dare to think of what would happen, where I'd be if I fell
25
+
26
+ Under attack, I'm being taken
27
+ About to crack, defences breaking
28
+ Won't somebody please have a heart
29
+ Come and rescue me now 'cause I'm falling apart
30
+ Under attack, I'm taking cover
31
+ He's on my track, my chasing lover
32
+ Thinking nothing's gonna stop him now
33
+ Should I want to, I'm not sure I won't know how
34
+
35
+ Under attack, I'm being taken
36
+ About to crack, defences breaking
37
+ Won't somebody see and save a heart
38
+ Come and rescue me now 'cause I'm falling apart
39
+ Under attack, I'm taking cover
40
+ He's on my track, my chasing lover
41
+ Thinking nothing can stop him now
42
+ Should I want to, I'm not sure I would know how
43
+
44
+ Under attack, I'm being taken
45
+ About to crack, defences breaking
46
+ Won't somebody please have a heart
47
+ Come and rescue me now 'cause I'm falling apart
48
+ Under attack, I'm taking cover
@@ -303,14 +303,13 @@ class LyricsTranscriber:
303
303
  previous_two_corrected_lines = ""
304
304
  upcoming_two_uncorrected_lines = ""
305
305
 
306
- if segment["id"] > 2:
307
- for previous_segment in corrected_lyrics_dict["segments"]:
308
- if previous_segment["id"] in (segment["id"] - 2, segment["id"] - 1):
309
- previous_two_corrected_lines += previous_segment["text"].strip() + "\n"
310
-
311
- for next_segment in self.outputs["transcription_data_dict"]["segments"]:
312
- if next_segment["id"] in (segment["id"] + 1, segment["id"] + 2):
313
- upcoming_two_uncorrected_lines += next_segment["text"].strip() + "\n"
306
+ for previous_segment in corrected_lyrics_dict["segments"]:
307
+ if previous_segment["id"] in (segment["id"] - 2, segment["id"] - 1):
308
+ previous_two_corrected_lines += previous_segment["text"].strip() + "\n"
309
+
310
+ for next_segment in self.outputs["transcription_data_dict"]["segments"]:
311
+ if next_segment["id"] in (segment["id"] + 1, segment["id"] + 2):
312
+ upcoming_two_uncorrected_lines += next_segment["text"].strip() + "\n"
314
313
 
315
314
  llm_transcript_segment += f"--- Segment {segment['id']} / {total_segments} ---\n"
316
315
  llm_transcript_segment += f"Previous two corrected lines:\n\n{previous_two_corrected_lines}\nUpcoming two uncorrected lines:\n\n{upcoming_two_uncorrected_lines}\nData input:\n\n{segment_input}\n"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lyrics-transcriber
3
- Version: 0.12.8
3
+ Version: 0.12.9
4
4
  Summary: Automatically create synchronised lyrics files in ASS and MidiCo LRC formats with word-level timestamps, using Whisper and lyrics from Genius and Spotify
5
5
  Home-page: https://github.com/karaokenerds/python-lyrics-transcriber
6
6
  License: MIT
@@ -3,14 +3,15 @@ lyrics_transcriber/llm_prompts/README.md,sha256=DPAGRDVGt9ZNcQAAoQGFhwesLY3D6hD8
3
3
  lyrics_transcriber/llm_prompts/llm_prompt_lyrics_correction_andrew_handwritten_20231118.txt,sha256=a3XjAYfyhWt1uCKKqm_n2Pc0STdmBdiHHtJ7ODP99Nk,4046
4
4
  lyrics_transcriber/llm_prompts/llm_prompt_lyrics_correction_gpt_optimised_20231119.txt,sha256=r6HN3DD_3gwh3B_JPd2R0I4lDXuB5iy7B90J9agOxbQ,2369
5
5
  lyrics_transcriber/llm_prompts/llm_prompt_lyrics_matching_andrew_handwritten_20231118.txt,sha256=hvk2Vs3M3Q4zGQsiQnXvnpd8wXWfwsudYeqN5qFyNWs,1754
6
- lyrics_transcriber/llm_prompts/promptfooconfig.yaml,sha256=Qm2GsQh2AoKJfskC3V92E5jtDg8zT9yKVgChUqeE9yw,1416
7
- lyrics_transcriber/transcriber.py,sha256=c6F6-BWnzq3KDtsMHshYYstWAkQDyYseoxdFgsYAo6U,38748
6
+ lyrics_transcriber/llm_prompts/promptfooconfig.yaml,sha256=O4YxlLV7XSUiSw_1Q9G7ELC2VAbrYUV_N5QxrPbd1jE,3735
7
+ lyrics_transcriber/llm_prompts/test_data/ABBA-UnderAttack-Genius.txt,sha256=8d-RvZtyINKUlpQLwMi-VD--Y59J-epPt7SZSqjFbPI,1690
8
+ lyrics_transcriber/transcriber.py,sha256=ykodPGx-bDmT3BBGY5MywfMfmUGUrUsQw7C-k-PzYS0,38686
8
9
  lyrics_transcriber/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
10
  lyrics_transcriber/utils/ass.py,sha256=b8lnjgXGD1OD1ld_b1xxUmSOf4nSEfz9BpgSkh16R4g,90291
10
11
  lyrics_transcriber/utils/cli.py,sha256=-xzokp8RZMh8DDCr-PZbh4yHqlnJP70Ts62-VnjZq48,6398
11
12
  lyrics_transcriber/utils/subtitles.py,sha256=GPLbo9oX3WJIY4wRO40k0RZF-UqvKjr2LFnXVOS0RHI,10762
12
- lyrics_transcriber-0.12.8.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
13
- lyrics_transcriber-0.12.8.dist-info/METADATA,sha256=NHYdhOYcWQjEHBVQgIsMUIro0wFCq2XG0_rxKDOl_RM,5051
14
- lyrics_transcriber-0.12.8.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
15
- lyrics_transcriber-0.12.8.dist-info/entry_points.txt,sha256=lh6L-iR5CGELaNcouDK94X78eS5Ua_tK9lI4UEkza-k,72
16
- lyrics_transcriber-0.12.8.dist-info/RECORD,,
13
+ lyrics_transcriber-0.12.9.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
14
+ lyrics_transcriber-0.12.9.dist-info/METADATA,sha256=et_XjNqSkHONMdJ8KlO9olAK3KkAQ4Wz7HIR8rw0YP0,5051
15
+ lyrics_transcriber-0.12.9.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
16
+ lyrics_transcriber-0.12.9.dist-info/entry_points.txt,sha256=lh6L-iR5CGELaNcouDK94X78eS5Ua_tK9lI4UEkza-k,72
17
+ lyrics_transcriber-0.12.9.dist-info/RECORD,,