Skip to content

Commit 57cc589

Browse files
committed
public push
1 parent 15c039f commit 57cc589

10 files changed

+45
-2389
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,4 @@ dmypy.json
128128

129129
# Pyre type checker
130130
.pyre/
131+
data*

README.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,34 @@ CONTENT_URL=https://augie-public-test.s3.amazonaws.com/89e5915c-cf8b-4f18-9b22-3
1818
docker-compose up --build
1919
```
2020

21+
## settings
22+
23+
```python
24+
def request_transcript():
25+
transcript_request = {
26+
'audio_url': content_url,
27+
#'filter_profanity': True, # Profanity Filtering https://www.assemblyai.com/docs/core-transcription#profanity-filtering
28+
#'punctuate': True, # Automate Punctuation and Casing https://www.assemblyai.com/docs/core-transcription#automatic-punctuation-and-casing
29+
#'language_detection': True, # Automatic Language Detection https://www.assemblyai.com/docs/core-transcription#automatic-language-detection
30+
#'auto_highlights': True, # Detect Important Phrases and Words https://www.assemblyai.com/docs/audio-intelligence#detect-important-phrases-and-words
31+
#'content_safety': True, # Content Moderation https://www.assemblyai.com/docs/audio-intelligence#content-moderation
32+
#'iab_categories': True, # Topic Detection(IAB Categories) https://www.assemblyai.com/docs/audio-intelligence#topic-detection-iab-classification
33+
#'sentiment_analysis': True, # Sentiment Analysis https://www.assemblyai.com/docs/audio-intelligence#sentiment-analysis
34+
#'summary_type': 'bullets', # Summary bullets https://www.assemblyai.com/docs/audio-intelligence#summarization
35+
#'summary_type': 'gist', # Summary gist
36+
#'summary_type': 'headline', # Summary headline
37+
#'summary_type': 'paragraph', # Summary paragraph
38+
#'auto_chapters': True, # Automatic Chapters https://www.assemblyai.com/docs/audio-intelligence#auto-chapters
39+
#'entity_detection': True, # Entity Detection https://www.assemblyai.com/docs/audio-intelligence#entity-detection
40+
'dual_channel': False
41+
}
42+
```
43+
2144
## results
2245

23-
### paragraph
46+
output will be saved to `data.*.*` files
47+
48+
### paragraph example
2449

2550
```json
2651
[

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.7"
22
services:
33
operator:
44
build: .
5-
image: assemgly_ai:0.1.0
5+
image: assembly_ai:0.1.0
66
env_file:
77
- default.env
88
volumes:

main.py

+17-16
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@
1818
def request_transcript():
1919
transcript_request = {
2020
'audio_url': content_url,
21-
'filter_profanity': True, # Profanity Filtering https://www.assemblyai.com/docs/core-transcription#profanity-filtering
22-
'punctuate': True, # Automate Punctuation and Casing https://www.assemblyai.com/docs/core-transcription#automatic-punctuation-and-casing
23-
'language_detection': True, # Automatic Language Detection https://www.assemblyai.com/docs/core-transcription#automatic-language-detection
24-
'auto_highlights': True, # Detect Important Phrases and Words https://www.assemblyai.com/docs/audio-intelligence#detect-important-phrases-and-words
25-
'content_safety': True, # Content Moderation https://www.assemblyai.com/docs/audio-intelligence#content-moderation
26-
'iab_categories': True, # Topic Detection(IAB Categories) https://www.assemblyai.com/docs/audio-intelligence#topic-detection-iab-classification
27-
'sentiment_analysis': True, # Sentiment Analysis https://www.assemblyai.com/docs/audio-intelligence#sentiment-analysis
28-
'summary_type': 'bullets', # Summary bullets https://www.assemblyai.com/docs/audio-intelligence#summarization
21+
#'filter_profanity': True, # Profanity Filtering https://www.assemblyai.com/docs/core-transcription#profanity-filtering
22+
#'punctuate': True, # Automate Punctuation and Casing https://www.assemblyai.com/docs/core-transcription#automatic-punctuation-and-casing
23+
#'language_detection': True, # Automatic Language Detection https://www.assemblyai.com/docs/core-transcription#automatic-language-detection
24+
#'auto_highlights': True, # Detect Important Phrases and Words https://www.assemblyai.com/docs/audio-intelligence#detect-important-phrases-and-words
25+
#'content_safety': True, # Content Moderation https://www.assemblyai.com/docs/audio-intelligence#content-moderation
26+
#'iab_categories': True, # Topic Detection(IAB Categories) https://www.assemblyai.com/docs/audio-intelligence#topic-detection-iab-classification
27+
#'sentiment_analysis': True, # Sentiment Analysis https://www.assemblyai.com/docs/audio-intelligence#sentiment-analysis
28+
#'summary_type': 'bullets', # Summary bullets https://www.assemblyai.com/docs/audio-intelligence#summarization
2929
#'summary_type': 'gist', # Summary gist
3030
#'summary_type': 'headline', # Summary headline
3131
#'summary_type': 'paragraph', # Summary paragraph
32-
'auto_chapters': True, # Automatic Chapters https://www.assemblyai.com/docs/audio-intelligence#auto-chapters
33-
'entity_detection': True, # Entity Detection https://www.assemblyai.com/docs/audio-intelligence#entity-detection
32+
#'auto_chapters': True, # Automatic Chapters https://www.assemblyai.com/docs/audio-intelligence#auto-chapters
33+
#'entity_detection': True, # Entity Detection https://www.assemblyai.com/docs/audio-intelligence#entity-detection
34+
'dual_channel': False
3435
}
3536
transcript_response = requests.post(
3637
transcript_endpoint,
@@ -80,7 +81,7 @@ def main():
8081
# save request transcript
8182
transcript_response = request_transcript()
8283
json_object = json.dumps(transcript_response, indent=4)
83-
with open('request.json', 'w') as outfile:
84+
with open('data.request.json', 'w') as outfile:
8485
outfile.write(json_object)
8586

8687
# poll and wait
@@ -89,31 +90,31 @@ def main():
8990

9091
# save transcription
9192
json_object = json.dumps(transcription, indent=4)
92-
with open('transcription.json', 'w') as outfile:
93+
with open('data.transcription.json', 'w') as outfile:
9394
outfile.write(json_object)
9495

9596
# save paragraphs
9697
paragraphs = get_paragraphs(polling_endpoint)
9798
json_object = json.dumps(paragraphs, indent=4)
98-
with open('paragraphs.json', 'w') as outfile:
99+
with open('data.paragraphs.json', 'w') as outfile:
99100
outfile.write(json_object)
100101

101102
# save sentences
102103
sentences = get_sentences(polling_endpoint)
103104
json_object = json.dumps(sentences, indent=4)
104-
with open('sentences.json', 'w') as outfile:
105+
with open('data.sentences.json', 'w') as outfile:
105106
outfile.write(json_object)
106107

107108
# save srt
108109
response = requests.get(polling_endpoint + '/srt', headers=headers)
109110
response = response.text
110-
with open('srt.txt', 'w') as outfile:
111+
with open('data.srt.txt', 'w') as outfile:
111112
outfile.write(response)
112113

113114
# save vtt
114115
response = requests.get(polling_endpoint + '/vtt', headers=headers)
115116
response = response.text
116-
with open('vtt.txt', 'w') as outfile:
117+
with open('data.vtt.txt', 'w') as outfile:
117118
outfile.write(response)
118119

119120
if __name__ == '__main__':

0 commit comments

Comments
 (0)