This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "scripting-css-transforms-with-dommatrix": { | |
| "title": "Scripting CSS transforms with DOMMatrix", | |
| "description": "I recently discovered that the css transform of an element can be set to the stringified value of a DOMMatrix. This means that we can use a DOMMatrix instance to construct the transforms, scales, and rotates that we need, and then set that instance as the value of the element's transform.", | |
| "image": "https://cdn.hashnode.com/res/hashnode/image/unsplash/05A-kdOH6Hw/upload/v1652988357121/7_tZoENAT.jpeg" | |
| }, | |
| "bundling-a-non-modular-codebase-lessons-learned": { | |
| "title": "Bundling a Non-Modular Codebase: Lessons Learned", | |
| "description": "I recently had the unenviable task of refactoring my employer's main frontend codebase. Here's what I learned about bundling non-modular JavaScript.", | |
| "image": "https://cdn.hashnode.com/res/hashnode/image/unsplash/McX3XuJRsUM/upload/v1653257331543/O4wnAkhXW.jpeg" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [run] explanation script chunks for sentence 1: [ | |
| "Marie: [cheerfully] Bonjour à tous et à toutes ! Aujourd'hui, nous allons apprendre à traduire la phrase suivante, dans trois, deux, un [short pause]: « [very slowly for emphasis] Mais arrêtez donc de dire toujours et encore félicitations. ».", | |
| "Marie: [short pause] [warmly] Alors, Clément, qu'est-ce que tu penses de cette phrase ?", | |
| `Clément: [warmly] Bien, cette phrase veut dire [short pause]: "[English explanation] But stop saying 'congratulations' over and over again.". [short pause] And what can you tell us about the verbs used in this sentence, Marie?`, | |
| 'Marie: [warmly] Les verbes utilisés ici sont "arrêtez" qui est conjugué de "arrêter" qui signifie "[English explanation] to stop; to cease" et "dire" qui est conjugué de "dire" qui signifie "[English explanation] to say; to tell".', | |
| `Clément: [warmly] C'est vraiment intéressant! Ensuite, voici des autres mots que vous devez connaître [inhales deeply]: "Mais" signifie "[English explanation] But |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function generateExplanationScript( | |
| processedSentence: ProcessedSentenceResult | |
| ): string[] { | |
| const { sentence, translatedText, verbs, vocabulary, idiomaticExpressions } = | |
| processedSentence; | |
| const explanationParts: string[] = []; | |
| // start by reading out the sentence | |
| explanationParts.push( | |
| `${PRESENTERS.MARIE.name}: [cheerfully] Bonjour à tous et à toutes ! Aujourd'hui, nous allons apprendre à traduire la phrase suivante, dans trois, deux, un [short pause]: « [very slowly for emphasis] ${sentence} ».` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as z from 'zod' | |
| const TranslationSchema = z.object({ | |
| translatedText: z.string().describe('The translated text'), | |
| verbs: z.array( | |
| z.object({ | |
| conjugatedForm: z.string().describe('The verb form as it shows up in the text'), | |
| infinitive: z.string().describe('The infinitive form of the verb'), | |
| meaning: z.string().describe('The meaning of the verb'), | |
| }).describe('A verb used in the text') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "sentence": "Mais arrêtez donc de dire toujours et encore félicitations.", | |
| "translation": { | |
| "translatedText": "But stop saying 'congratulations' over and over again.", | |
| "verbs": [ | |
| { | |
| "conjugatedForm": "arrêtez", | |
| "infinitive": "arrêter", | |
| "meaning": "to stop; to cease" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "words": [ | |
| { | |
| "word": "mais", | |
| "start": 0, | |
| "end": 0.39999998, | |
| "confidence": 0.9428711, | |
| "punctuated_word": "Mais" | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| from fastapi.concurrency import run_in_threadpool | |
| ... | |
| def prepare_for_upload_synchronously(): | |
| pass | |
| def upload_to_s3(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| class TextReplacement(BaseModel): | |
| replaced_text: str = Field(description="The updated text after replacing entities.") | |
| ... | |
| class DemoEnrichmentAgent: | |
| ... | |
| entity_replacer_llm: Runnable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| Agent response: | |
| { | |
| "transcript_text": "Hollywood director Kristoffer Nolen has announced his next big project, rumored to be another complex sci-fi thriller. Fans of Nolen\u2019s earlier work are eager to see if this film will rival the success of \u2018Inceptshun\u2019 or \u2018Dunkrik.\u2019", | |
| "extracted_entities": { | |
| "named_entities": [ | |
| { | |
| "entity_name": "Kristoffer Nolen", | |
| "entity_context": "Hollywood director known for sci-fi thrillers" |