Latest / CyberSecurity Summary / Mastering spaCy: Build structured NLP solutions with custom components and models powered by spacy-llm
Transcript
- 0:00Speaker 1: Welcome to the deep dive, where we slice through the
- 0:02Speaker 1: information clutter to bring you the clearest, most important insights. Today,
- 0:07Speaker 1: we're taking a bit of a shortcut to becoming well
- 0:09Speaker 1: informed about a really powerful tool in natural language processing NLP.
- 0:14Speaker 2: It's called Spacey, that's right, and it's an interesting one.
- 0:18Speaker 2: If you think of those huge language models, you know,
- 0:20Speaker 2: like chat, GPT, maybe is a big powerful food processor. Okay,
- 0:24Speaker 2: then Spacey is more like your practical, really well optimized
- 0:29Speaker 2: kitchen knife. It's a library that's specifically designed to help
- 0:33Speaker 2: you get actual work done.
- 0:34Speaker 1: So moving beyond just theory.
- 0:36Speaker 2: Exactly beyond just academic concepts and do efficient practical application.
- 0:40Speaker 2: And we're going to uncover some surprising depth today. I
- 0:43Speaker 2: think from you know, basic text processing right up to
- 0:46Speaker 2: integrating with the latest AI stuff.
- 0:48Speaker 1: Sounds good, And our mission for this deep dive is
- 0:51Speaker 1: basically to give you a comprehensive but still really accessible
- 0:56Speaker 1: understanding of what Spacey can do. We're drawing from quite
- 0:59Speaker 1: a few sources, including the excellent book Mastering Spacey. Okay,
- 1:05Speaker 1: let's untack this. So to kick us off, what's the
- 1:08Speaker 1: absolute core thing our listeners should get about Spacey.
- 1:12Speaker 2: Well at its heart. Spacey is this incredibly fast open
- 1:15Speaker 2: source Python library, and it's really built for production ready
- 1:21Speaker 2: NLP applications.
- 1:22Speaker 1: Production ready. That sounds important.
- 1:24Speaker 2: It is, a lot of its speed comes from using
- 1:26Speaker 2: Python for the really performance critical bids, so it's highly
- 1:30Speaker 2: optimized but still easy to use within Python.
- 1:33Speaker 1: Aha. So it's not just another like academic tool set.
- 1:35Speaker 1: It's built for real world stuff from the.
- 1:37Speaker 2: Get go precisely. That's a key difference compared to maybe
- 1:40Speaker 2: something like NLTK, the Natural Language Toolkit, which historically at
- 1:43Speaker 2: least was often more focused on students researchers. Spacey, you're
- 1:47Speaker 2: hitting the ground running for deployment.
- 1:48Speaker 1: You mentioned it's built to get work done? Is that
- 1:50Speaker 1: like the official philosophy pretty much?
- 1:53Speaker 2: Inus Montani? What are the core? Creators? Often talks about this.
- 1:57Speaker 2: The goal is genuinely to help people do their work efficiently.
- 2:00Speaker 2: They're not trying to build some massive do everything system.
- 2:03Speaker 2: Oh okay, it's more about providing these sharp, reliable tools
- 2:06Speaker 2: like that knife, to fit nicely into whatever you're already doing.
- 2:10Speaker 1: Got it and getting started? Is it complex?
- 2:15Speaker 2: Not? Really? It works with modern Python runs on you know,
- 2:17Speaker 2: the usual operating systems, Windows, Mac, Linux.
- 2:21Speaker 1: And best practice is probably virtual environments. Right.
- 2:24Speaker 2: Keep things clean, Oh, absolutely, always a good idea for
- 2:27Speaker 2: any Python project. Keeps your dependency sorted.
- 2:29Speaker 1: Now you mentioned something important. The language models aren't built
- 2:33Speaker 1: in correct.
- 2:33Speaker 2: That's a key point. Spacey itself is the framework, the tools,
- 2:38Speaker 2: but for the statistical smarts, things like tagging parts of
- 2:40Speaker 2: speech or finding named entities, you need to download a
- 2:43Speaker 2: language model separately.
- 2:45Speaker 1: Like Encore websism, that kind of thing exactly like encore
- 2:48Speaker 1: webdism for English.
- 2:49Speaker 2: This quick command line thing Python dash M, Spacey download
- 2:52Speaker 2: oncre webism that downloads the small English model, gets you
- 2:56Speaker 2: the core pipeline components.
- 2:58Speaker 1: Okay, and once you've got that, how do you sort
- 2:59Speaker 1: of of see what it's doing.
- 3:01Speaker 2: Oh well, that's where displacy comes in. It's Spacey's built
- 3:04Speaker 2: in visualization tool, and it's fantastic. How So, it just
- 3:08Speaker 2: makes really complex linguistic concepts much easier to grasp visually.
- 3:14Speaker 2: You could see dependency parses how words connect, or see
- 3:18Speaker 2: named entities highlighted right in the text. It helps you
- 3:20Speaker 2: spot patterns almost.
- 3:22Speaker 1: Instantly, so you can actually see the analysis.
- 3:24Speaker 2: Yeah, you can try it online. There's a demo, or
- 3:26Speaker 2: you can run it locally from your code. Even in
- 3:29Speaker 2: Jupiter notebooks. It's super helpful for understanding what's going on
- 3:32Speaker 2: into the hood.
- 3:32Speaker 1: Okay, so set up, done, model, downloaded, visualization. Ready, let's
- 3:37Speaker 1: talk about the core processing. You mentioned a pipeline.
- 3:39Speaker 2: Yeah, I think of it like an NLP assembly line.
- 3:42Speaker 2: When you load a model, say using spacey dot load,
- 3:45Speaker 2: you get back this NLP object, right, And when you
- 3:48Speaker 2: feed text into that object like doc NLP, this is
- 3:51Speaker 2: some text. It runs the text through a sequence of
- 3:54Speaker 2: processing steps.
- 3:55Speaker 1: The pipeline components exactly.
- 3:57Speaker 2: The default pipeline usually include. It's a tokenizer, a tagger
- 4:01Speaker 2: for part of speech, a dependency parser for sentence structure,
- 4:05Speaker 2: and an entity recognizer or any R component. Each does
- 4:10Speaker 2: its specific.
- 4:10Speaker 1: Job, and the output is this doc object.
- 4:13Speaker 2: Right. The doc object holds the result. It's not just
- 4:16Speaker 2: the text, it's the text broken down into tokens, and
- 4:19Speaker 2: each token is enriched with all the linguistic features found
- 4:22Speaker 2: by the pipeline.
- 4:23Speaker 1: Let's break down that pipeline. First up, Tokenization and sentence
- 4:26Speaker 1: segmentation sounds simple, just splitting words, Ah.
- 4:29Speaker 2: Well, it's a bit more nuanced than just splitting on spaces.
- 4:32Speaker 2: Tokenization is breaking the text into its smallest meaningful parts,
- 4:36Speaker 2: the tokens, words, numbers, punctuation. They all become tokens. Okay,
- 4:40Speaker 2: But here's a surprising detail. Unlike most other pipeline components,
- 4:44Speaker 2: the default tokenizer doesn't rely on a statistical model.
- 4:47Speaker 1: Oh which does it use?
- 4:49Speaker 2: It uses really carefully crafted language specific rules, which makes
- 4:52Speaker 2: it very fast and predictable. And you can even customize it.
- 4:55Speaker 2: You can add special cases like telling it how to
- 4:57Speaker 2: handle slang or specific abbreviations.
- 4:59Speaker 1: Let's teach it lemmey should be lemon me exactly.
- 5:02Speaker 2: That kind of thing gives you fine grain control.
- 5:04Speaker 1: And sentence segmentation, finding sentence boundaries that's.
- 5:08Speaker 2: Actually often more complex than tokenization. Think about abbreviations like
- 5:13Speaker 2: misder or complex punctuation. Spacey has a unique approach here.
- 5:19Speaker 2: What's that It often uses the dependency parser, which understands
- 5:22Speaker 2: sentence structure to help figure out sentence boundaries really accurately.
- 5:26Speaker 2: It's quite a sophisticated design choice.
- 5:28Speaker 1: Interesting. Okay, Next step lematization getting the root word yep.
- 5:32Speaker 2: The lemma is the base or dictionary form. So like
- 5:35Speaker 2: you said, eating eats eat tape, they all boil down
- 5:38Speaker 2: to the lemma eat.
- 5:39Speaker 1: How useful is that in practice?
- 5:41Speaker 2: Oh, incredibly useful. Think about a chatbot for booking flights.
- 5:45Speaker 2: A user might say I want to fly, or show
- 5:47Speaker 2: me flights or I flew yesterday.
- 5:49Speaker 1: Right, different forms of the same core idea exactly.
- 5:52Speaker 2: Lemonization reduces fly flights flu all down to fly, so
- 5:56Speaker 2: your system only needs to look for that one base
- 5:58Speaker 2: form to understand the core intent. It simplifies things massively.
- 6:02Speaker 1: Makes sense, and you could use it for other things too,
- 6:04Speaker 1: like place names.
- 6:05Speaker 2: Definitely maybe sometimes angel Town when they mean Los Angeles.
- 6:09Speaker 2: You can actually add custom rules using something called an
- 6:11Speaker 2: a tribune ruler to map Angeltown to the canonical Los
- 6:14Speaker 2: Angeles lemma. During processing insures consistency.
- 6:18Speaker 1: So Spacey processes the text, applies these steps and stores
- 6:22Speaker 1: the results you mentioned. Container objects, doc, token span.
- 6:26Speaker 2: Right, these are your main ways of accessing the processed information.
- 6:30Speaker 2: The doc object represents the whole processed text. Okay, if
- 6:33Speaker 2: you loop over a doc like for token and doc,
- 6:35Speaker 2: you get individual token objects.
- 6:37Speaker 1: And each token knows things about itself.
- 6:39Speaker 2: Loads of things. A token object holds the original word,
- 6:42Speaker 2: it's lemma, it's part of speech tag, it's dependency relation.
- 6:45Speaker 2: It also has boolean flags like token dot is punk,
- 6:48Speaker 2: token dot is currency token dot like earl, token dot
- 6:51Speaker 2: latham wow.
- 6:52Speaker 1: Okay, So you can check if a token looks like
- 6:54Speaker 1: a URL or a number easily yep.
- 6:56Speaker 2: And it knows it's entity type if it's part of
- 6:58Speaker 2: one like token do type might be person or or worg.
- 7:02Speaker 2: It even has a token dot shave attribute that gives
- 7:06Speaker 2: you a kind of abstract representation of the words orthography,
- 7:08Speaker 2: like is it capitalized, is it all digits, et cetera.
- 7:11Speaker 2: Really useful for rule base matching.
- 7:13Speaker 1: And span What does that fit in?
- 7:15Speaker 2: A span? Is just a slice of the dock representing
- 7:17Speaker 2: multiple tokens. Sentences are span objects. You can get them
- 7:21Speaker 2: via doc dot sense. Named entities are also span objects,
- 7:25Speaker 2: accessible via doc dot NZ. So doc token span or
- 7:29Speaker 2: how you navigate and use the process.
- 7:31Speaker 1: Text got it. Let's move into some of those linguistic
- 7:33Speaker 1: features part of speech tagging pos tagging. That's identifying nouns, verbs, adjectives.
- 7:39Speaker 2: Exactly, categorizing words by their grammatical role in the sentence.
- 7:43Speaker 1: And how does space you figure that out? Is it
- 7:45Speaker 1: just a dictionary look up?
- 7:46Speaker 2: Oh no, it's much smarter than that. It looks at
- 7:48Speaker 2: the word in context. The surrounding words heavily influence the tag.
- 7:51Speaker 2: It uses sequential statistical models trained on large amounts of texts.
- 7:56Speaker 1: So the same word could get different tags.
- 7:58Speaker 2: Absolutely. Think of the word book, I read a book
- 8:02Speaker 2: noun versus I want to book a flight verb. The
- 8:05Speaker 2: context tells the tagger which role it's playing.
- 8:08Speaker 1: And why is this useful beyond just grammar?
- 8:11Speaker 2: Well, it's really important for understanding meaning, especially for word
- 8:15Speaker 2: sense disambiguation, figuring out which meaning of a word is intended.
- 8:18Speaker 1: Can you give an example?
- 8:19Speaker 2: Sure, take the word beat. It can mean many things,
- 8:22Speaker 2: But if the pos tagger confidently tags it as an
- 8:25Speaker 2: adjective adj, as in I'm totally beat, you know, it
- 8:28Speaker 2: almost certainly means exhausted. Ah.
- 8:31Speaker 1: I see. The tag helps narrow down the meaning.
- 8:33Speaker 2: Precisely, even if the verb or noun tags might still
- 8:36Speaker 2: be ambiguous. Beat the drum versus follow the beat. The
- 8:40Speaker 2: adjective tag is often quite specific. It adds a layer
- 8:43Speaker 2: of understanding, even if lamonization kind of flattens out things
- 8:46Speaker 2: like verb tense.
- 8:47Speaker 1: Okay, that makes sense. Next up, dependency parsing. This sounds
- 8:50Speaker 1: a bit more complex. Mapping sentence relationships.
- 8:53Speaker 2: It is complex but incredibly powerful. Dependency parsing represents the
- 8:57Speaker 2: grammatical structure of a sentence not just as a flat sequence,
- 9:01Speaker 2: but as a tree of relationships. It shows how words
- 9:03Speaker 2: depend on each.
- 9:04Speaker 1: Other head and dependent exactly each.
- 9:06Speaker 2: Word except usually the main verb. The root has a
- 9:09Speaker 2: head word it modifies or relates to, and a specific
- 9:12Speaker 2: dependency label describes that relationship, like N subject phenomenal subject,
- 9:17Speaker 2: or dubject for direct object. Why go to all this trouble, Well,
- 9:20Speaker 2: what's fascinating here is that sentences aren't just sequences of tokens.
- 9:24Speaker 2: They have this deep, inherent structure, and understanding that structure
- 9:27Speaker 2: is absolutely crucial for many real world NLP tasks, like
- 9:32Speaker 2: what think about chatbots or a machine translation? You need
- 9:36Speaker 2: to know who did what to whom. Consider I forwarded
- 9:39Speaker 2: you the email versus you forwarded me the email.
- 9:42Speaker 1: Same words, totally different meaning exactly.
- 9:44Speaker 2: Dependency parsing helps the system figure out that I is
- 9:47Speaker 2: the subject the one doing the forwarding in the first sentence,
- 9:50Speaker 2: and you as the subject in the second. It disambiguates
- 9:53Speaker 2: the roles based on the grammatical structure unsubject, DUBJIOJ relationships.
- 9:58Speaker 2: Without that, I understand user intent would be much much.
- 10:02Speaker 1: Harder, right, That makes the importance clear. Okay, what about
- 10:05Speaker 1: named entity recognition any R spotting real world objects?
- 10:09Speaker 2: Yep. A named entity is basically anything that can be
- 10:12Speaker 2: referred to with a proper name or a quantity. So
- 10:16Speaker 2: people's names, company names, locations, dates, monetary values, percentages.
- 10:21Speaker 1: The categories seem pretty standard person or or GPE geopolitical entity.
- 10:27Speaker 2: Those are common ones, yes, but the specific set of
- 10:30Speaker 2: entity types is actually quite flexible and often depends on
- 10:33Speaker 2: the data of the model was trained on or the
- 10:35Speaker 2: specific task you have in mind. How so, Well, if
- 10:38Speaker 2: you're analyzing financial news, entities like money and percentage might
- 10:43Speaker 2: be way more important and frequent than say, work of art.
- 10:46Speaker 2: The model needs to be tailored or chosen based on
- 10:49Speaker 2: the domain.
- 10:50Speaker 1: And how good as any are these days.
- 10:51Speaker 2: It's gotten incredibly good. The state of the art methods
- 10:54Speaker 2: often use those transformer architectures we mentioned earlier. They're very
- 10:58Speaker 2: effective at understanding context to identify entities accurately.
- 11:01Speaker 1: Okay, And sometimes the default tokenization or entity spans might
- 11:05Speaker 1: not be quite right. Can you fix them?
- 11:08Speaker 2: Yes? Absolutely. Spacey provides a really neat mechanism called doc
- 11:11Speaker 2: dot retokenize it lets you merge multiple tokens into one,
- 11:14Speaker 2: or split a single token into several.
- 11:16Speaker 1: Why would you need to do that?
- 11:17Speaker 2: Well, maybe an entity like New York City got split
- 11:19Speaker 2: into three tokens, but you want to treat it as
- 11:22Speaker 2: a single unit for analysis, you can merge them. Or
- 11:25Speaker 2: maybe a typo resulted in San Francisco being one token
- 11:28Speaker 2: and you want to split it.
- 11:29Speaker 1: Ah okay, So for cleanup and normalization.
- 11:33Speaker 2: Exactly, merging is usually simpler. Splitting can be a bit
- 11:36Speaker 2: more involved because Spacey then needs to figure out the
- 11:39Speaker 2: linguistic features and dependencies for the new tokens you've created.
- 11:43Speaker 2: But it's a very powerful tool for practical adjustments.
- 11:46Speaker 1: Let's shift gear slightly to rule based matching. You mentioned
- 11:50Speaker 1: regular expressions can be tricky. What Spacey's alternative.
- 11:54Speaker 2: Spacey offers the matriclass, and it's designed to be a well,
- 11:58Speaker 2: a much cleaner, more readable, and definitely more maintainable alternative
- 12:02Speaker 2: for finding patterns and text compared to rejects.
- 12:05Speaker 1: Why is rejects problematic?
- 12:06Speaker 2: Regular expressions can just become incredibly dense and hard to read,
- 12:10Speaker 2: especially for complex patterns. They're also easy to get subtly wrong,
- 12:13Speaker 2: which can lead to bugs that are hard to track down,
- 12:16Speaker 2: and they operate purely on.
- 12:17Speaker 1: Strings, and the match is different how.
- 12:19Speaker 2: The matcher works with token objects and their attributes. You
- 12:22Speaker 2: define patterns not as strings, but as lists of dictionaries,
- 12:26Speaker 2: where each dictionary specifies the attributes.
- 12:29Speaker 1: A token must have like low to match the word
- 12:31Speaker 1: hello regardless.
- 12:32Speaker 2: Of case precisely, or is punched true to match any
- 12:36Speaker 2: punctuation mark or liken them true for number. Like tokens,
- 12:41Speaker 2: you're matching based on linguistic features, not just character sequences.
- 12:44Speaker 1: That sounds much more robust.
- 12:45Speaker 2: It is, and you can use extended syntax too. You
- 12:48Speaker 2: can match based on token length length check off a
- 12:51Speaker 2: token is in a list I note or use boolean
- 12:54Speaker 2: flags like east digit I, sulfa I supper great for finding, say,
- 12:58Speaker 2: emphasized words in all cans.
- 13:00Speaker 1: Does it have rejects like operators like optional parts.
- 13:03Speaker 2: Yes, you can use operators like bunds to make a
- 13:06Speaker 2: token pattern optional. Think about matching names like Barack Obama
- 13:09Speaker 2: but also Barack Hussein Obama. The middle name token can
- 13:13Speaker 2: be marked as optional, and you have operators like plus
- 13:17Speaker 2: one or more and zero or more for specifying occurrences,
- 13:21Speaker 2: similar to rejects. There's even a really useful online demo
- 13:25Speaker 2: on the Spacey website where you can build and test
- 13:28Speaker 2: matcher patterns interactively.
- 13:29Speaker 1: Okay, that covers matching specific patterns. What if you have
- 13:32Speaker 1: like a huge list of things to find, say thousands
- 13:35Speaker 1: of product names, right.
- 13:37Speaker 2: Creating individual matcher patterns for thousands of specific phrases would
- 13:41Speaker 2: be well, not very efficient or practical.
- 13:44Speaker 1: So what's the solution for that?
- 13:46Speaker 2: Spacey provides the phrase matcher. It's optimized specifically for efficiently
- 13:50Speaker 2: scanning text against large lists of multi word phrases or dictionaries.
- 13:53Speaker 1: How does that work?
- 13:54Speaker 2: You give it a list of doc objects representing the
- 13:56Speaker 2: phrases you want to find, like Angela Merkele, Donald Trump,
- 14:00Speaker 2: Alexis ceparus. It then uses a really efficient algorithm to
- 14:03Speaker 2: find all occurrences of those exact phrases in your target text,
- 14:07Speaker 2: much faster than running thousands of individual rules.
- 14:10Speaker 1: Very useful for terminology lists or gazetteers exactly.
- 14:14Speaker 2: And it can even match based on token attributes, not
- 14:17Speaker 2: just the exact words. For instance, you could match based
- 14:19Speaker 2: on the shape attribute, which is handy for finding structured
- 14:22Speaker 2: data like IP addresses or specific code patterns and log files.
- 14:26Speaker 2: Even if the exact digits change.
- 14:28Speaker 3: So you have the matcher for flexible patterns and phrase
- 14:31Speaker 3: matcher for large lists. How do you integrate these findings
- 14:35Speaker 3: back into the main spacey doc. That's where the span
- 14:38Speaker 3: ruler comes in. It's a pipeline component that lets you
- 14:40Speaker 3: use rules to find very similarly to matcher patterns, to
- 14:44Speaker 3: directly add span objects to your doc add themwhare to
- 14:47Speaker 3: doc dot sense. You can configure it to add them
- 14:49Speaker 3: to doc dot en, so effectively adding rule based named entities.
- 14:53Speaker 3: Or you can have it add them to a custom
- 14:54Speaker 3: span group like doc dot spans my custom patterns, so.
- 14:57Speaker 1: You added to the pipeline like other components.
- 14:58Speaker 2: YEP, NLP, dot X a pipe span ruler. Then you
- 15:02Speaker 2: provide it with your patterns. For example, you could define
- 15:04Speaker 2: a pattern to find every instance of the word chime
- 15:07Speaker 2: and label it as an OARG entity.
- 15:09Speaker 1: What if the regular ner model also finds entities? Do
- 15:13Speaker 1: they clash?
- 15:14Speaker 2: Good question. You can configure the span ruler. You can
- 15:18Speaker 2: tell it whether your rule based entities should overwrite entities
- 15:23Speaker 2: found by the statistical ner model, overrit true or not
- 15:28Speaker 2: overwrite falls. You can also set it up so that
- 15:31Speaker 2: statistical entities don't overwrite your rule based ones gives you
- 15:35Speaker 2: control over which source of entities takes precedence.
- 15:37Speaker 1: Okay, this rule based stuff seems really practical. Can we
- 15:41Speaker 1: talk about some specific recipes like real world extraction examples?
- 15:45Speaker 2: Absolutely, here's where it gets really interesting, showing Spacey's power.
- 15:49Speaker 2: So you can easily build patterns to extract things like ibands,
- 15:53Speaker 2: international bank account numbers, or phone numbers, these highly structured
- 15:56Speaker 2: numeric things.
- 15:57Speaker 1: Okay, what else?
- 15:58Speaker 2: Think about? Social media? Could create patterns to find mentions
- 16:02Speaker 2: expressing opinions, like matching the sequence business name plus iswaz
- 16:05Speaker 2: bay plus Maybe an adverb plus an adjective.
- 16:08Speaker 1: Like finding cafe X was really great.
- 16:10Speaker 2: Exactly that pattern structure cafex was a adverb adjective. Could
- 16:14Speaker 2: pick up cafe x is good, Cafe y was very slow,
- 16:17Speaker 2: restaurant z will be amazing. Helps you gauge sentiment clever.
- 16:20Speaker 1: Other examples.
- 16:21Speaker 2: Hashtags are easy. You can match the hashtag symbol followed
- 16:24Speaker 2: by tokens that meet certain criteria like IC or ICEULFA
- 16:28Speaker 2: to reliably pull out things like hashtag deep learning or
- 16:32Speaker 2: hashtag weekend fun.
- 16:33Speaker 1: And what about slightly more complex entities?
- 16:36Speaker 2: You can even use patterns to refine entities. For example,
- 16:40Speaker 2: maybe the ner just picks up Smith as a person.
- 16:43Speaker 2: You could use a match or pattern to look for
- 16:45Speaker 2: a preceding title like mister AM's doctor nump, and then
- 16:48Speaker 2: retokenize to merge the title and the name into a single,
- 16:52Speaker 2: more complete entity span Miss Smith.
- 16:54Speaker 1: Wow. Okay, that's quite granular.
- 16:56Speaker 2: Control, it really is. These rule based tools, combined with
- 16:59Speaker 2: the linguistic features, give you a lot of power for
- 17:02Speaker 2: precise information extraction.
- 17:04Speaker 1: Let's push deeper now into understanding meaning and intent. How
- 17:07Speaker 1: does spacey help with semantic parsing figuring out what a
- 17:09Speaker 1: user actually wants a great.
- 17:11Speaker 2: Way to explore this is with data sets like eighty
- 17:13Speaker 2: zis the airline travel information system. It contains thousands of
- 17:17Speaker 2: real user requests about.
- 17:19Speaker 1: Flights like show me flights from Boston to Denver exactly?
- 17:22Speaker 2: Or what's the cheapest flight? What meals are served on
- 17:25Speaker 2: flight x? Analyzing these requires understanding not just the words,
- 17:31Speaker 2: but the underlying goal.
- 17:33Speaker 1: Where do you even start with something like that?
- 17:35Speaker 2: Well, a really crucial first step, honestly, is just looking
- 17:38Speaker 2: at the data yourself. Read through a sample of the utterances,
- 17:42Speaker 2: get a feel for the common patterns. The types of
- 17:44Speaker 2: entities involved the grammar people use.
- 17:47Speaker 1: What kind of things would you look for in the
- 17:49Speaker 1: eightiest data.
- 17:51Speaker 2: You'd quickly notice people specifying origins and destinations. But it's
- 17:55Speaker 2: not enough just to spot Boston and Denver. You need
- 17:58Speaker 2: to capture the relationship from Boston to Denver. You'd see
- 18:01Speaker 2: the importance of prepositions like from to in Those little
- 18:05Speaker 2: words carry a lot of semantic.
- 18:06Speaker 1: Weight, So you need more than just finding keywords.
- 18:09Speaker 2: Definitely, you need to understand the relationships between the words.
- 18:13Speaker 2: And that's where Spacey's dependency matter.
- 18:15Speaker 1: Comes in another matcher. How's this one different?
- 18:17Speaker 2: Well, the matcher looks for sequences of tokens based on
- 18:19Speaker 2: their attributes. The dependency match looks for patterns based on
- 18:23Speaker 2: the syntactic dependency relationships between tokens.
- 18:26Speaker 1: Ah. Using that dependency parstry we talked about earlier.
- 18:29Speaker 2: Precisely, it lets you find patterns like a verb connected
- 18:33Speaker 2: to a noun with a direct object relationship dub J.
- 18:38Speaker 2: This is key for identifying intent.
- 18:40Speaker 1: Can you give a quick linguistic primer on that objects?
- 18:43Speaker 2: Sure? So? Very Basically, you have transitive verbs which need
- 18:47Speaker 2: an object to act upon, like I bought flowers flowers
- 18:50Speaker 2: is a direct object, and in transitive verbs which don't
- 18:54Speaker 2: like I slept okay. And sometimes there's an indirect object too,
- 18:57Speaker 2: like I gave him the book book is direct him
- 18:59Speaker 2: as direct. The dependency matcher lets you specify these relationships
- 19:03Speaker 2: in your patterns.
- 19:04Speaker 1: How does that help find intent in the flight examples.
- 19:08Speaker 2: Well, you could define a pattern looking for a verb
- 19:10Speaker 2: like show or find that has a direct object TOBJ
- 19:14Speaker 2: like flights. That pattern defined using dependency relations would match
- 19:19Speaker 2: show me flights, find flights, I need you to show flights, etc.
- 19:22Speaker 2: Capturing the core intent regardless of the exact phrasing.
- 19:25Speaker 1: That seems much more robust than just keyword spotting.
- 19:28Speaker 2: It is, and you can build more complex patterns. What
- 19:30Speaker 2: if someone says, show all flights and fares. The dependency
- 19:34Speaker 2: matcher can use the conjunct dependency link between flights and
- 19:38Speaker 2: fares to recognize that the user has two related intents
- 19:42Speaker 2: connected by and.
- 19:44Speaker 1: Okay, that's powerful, But this raises a question. Once you've
- 19:48Speaker 1: used these matchers to figure out the intent, say book flight,
- 19:51Speaker 1: how do you store that information with the doc?
- 19:54Speaker 2: Great question. You don't want that information just floating around
- 19:57Speaker 2: Spacey has a mechanism for this extension attributes exten attributes. Yeah,
- 20:01Speaker 2: you can define your own custom attributes on doc token
- 20:04Speaker 2: or span objects. So you could create an attribute called
- 20:07Speaker 2: say doc dot intent. The underscore indicates it's a custom
- 20:10Speaker 2: extension and how.
- 20:11Speaker 1: Do you set that attribute?
- 20:13Speaker 2: You typically create a custom spacey pipeline component use a
- 20:16Speaker 2: special decorator at language dot factory to define it. Inside
- 20:20Speaker 2: this component's call method, which processes the doc. You'd run
- 20:24Speaker 2: your matcher or dependency matcher, figure out the intent and
- 20:27Speaker 2: then set doc dot intent.
- 20:29Speaker 1: Book flight so you can tailor the pipeline to extract
- 20:31Speaker 1: and store exactly what you need exactly.
- 20:34Speaker 2: It makes spacing incredibly flexible and extensible for specific tasks.
- 20:38Speaker 1: Now we touched on performance earlier. What about processing large
- 20:42Speaker 1: data sets like the full eight is corpus with thousands
- 20:45Speaker 1: of utterances. Doing them one by one sounds slow.
- 20:49Speaker 2: It would be processing doc NLP text for each of
- 20:52Speaker 2: the four nine and seventy eight utterances individually would take
- 20:55Speaker 2: quite a while.
- 20:56Speaker 1: So what's the efficient way?
- 20:57Speaker 2: The key is the NLP dot pipe method or language
- 21:01Speaker 2: dot pipe. If you're using the base class.
- 21:03Speaker 1: How does pipe help?
- 21:04Speaker 2: It processes the text as a stream and crucially it
- 21:07Speaker 2: buffers them internally and processes them in batches. This allows
- 21:11Speaker 2: Spacey to leverage optimizations and parallel processing much more effectively.
- 21:15Speaker 1: And the speed difference is noticeable.
- 21:17Speaker 2: Oh, absolutely dramatic. The sources mentioned going from something like
- 21:20Speaker 2: twenty seven seconds for processing the eighties data set one
- 21:22Speaker 2: by one down to under six seconds using NLP dot pipe.
- 21:26Speaker 2: It's the standard way to process large volumes of text efficiently.
- 21:29Speaker 1: Okay, essential for any real world application. Let's pivot now
- 21:33Speaker 1: to the really cutting edge stuff, transformers and large language
- 21:37Speaker 1: models LMS. The transformer architecture kind of kick things off right.
- 21:41Speaker 1: The attention is all you need paper.
- 21:43Speaker 2: Yes, that twenty seventeen paper was a landmark. Transformers really
- 21:47Speaker 2: revolutionized NLP.
- 21:49Speaker 1: What problem were they trying to solve?
- 21:50Speaker 2: Well, Previous models like LSTMs process texts sequentially. This meant
- 21:55Speaker 2: they could struggle with long range dependencies for getting information
- 21:59Speaker 2: from the beginning of a law text, and they weren't
- 22:01Speaker 2: easily parallelizable, which limited training speed.
- 22:04Speaker 1: And transformers fix this how with attention exactly.
- 22:09Speaker 2: The core innovation is the self attention mechanism, often implemented
- 22:13Speaker 2: in a multi head attention block. Instead of just looking
- 22:16Speaker 2: at the immediately preceding words. Self attention allows the model
- 22:19Speaker 2: to weigh the importance of all words and the input
- 22:21Speaker 2: sequence when calculating the representation for a single word.
- 22:24Speaker 1: So it looks at the whole context at once.
- 22:27Speaker 2: Sort of yeah. It calculates a words embedding its representation
- 22:31Speaker 2: by taking a weighted average of the embeddings of all
- 22:34Speaker 2: other words in the sequence, where the weights the attention
- 22:38Speaker 2: scores indicate relevance. This lets it understand language much more
- 22:42Speaker 2: deeply in context.
- 22:44Speaker 1: What was the big aha moment with this?
- 22:47Speaker 2: A major one was that transformers could generate dynamic word vectors.
- 22:51Speaker 2: Older methods like word two VAC gave the same vector
- 22:54Speaker 2: for bank every time, but a transformer can understand a
- 22:57Speaker 2: context and give a different vector for bank and riverbank
- 23:00Speaker 2: versus bank in investment bank.
- 23:02Speaker 1: That's a huge leap in understanding nuance.
- 23:04Speaker 2: It really was. And libraries like Hugging Faces Transformers Library
- 23:08Speaker 2: now provide access to literally thousands of these pre trained
- 23:11Speaker 2: transformer models.
- 23:12Speaker 1: How does Spacey integrate with these? Can you use transformers
- 23:15Speaker 1: within a Spacey pipeline?
- 23:16Speaker 2: Yes? Absolutely. A great example is text classification. Let's say
- 23:20Speaker 2: you want to classify Amazon product reviews as positive or negative.
- 23:24Speaker 2: You can use Spacey's text categorizer component.
- 23:26Speaker 1: Which is trainable.
- 23:27Speaker 2: Right, it's a trainable pipeline component. You'd prepare your training
- 23:31Speaker 2: data the reviews labeled as positive or negative using Spacey's
- 23:34Speaker 2: example object, and then serialize it efficiently using doc ben.
- 23:38Speaker 1: How do you manage the training process itself?
- 23:42Speaker 2: Spacey has a really nice configuration system. Instead of hard
- 23:46Speaker 2: coding parameters, you define everything the pipeline components, model settings,
- 23:50Speaker 2: hyper parameters, data paths in a single configuration file configured
- 23:55Speaker 2: on CFG.
- 23:56Speaker 1: Why is that better?
- 23:57Speaker 2: It makes your experiment incredibly reproducible. Yeah, there are no
- 24:00Speaker 2: hidden de faults. Everything is explicit in the config file.
- 24:03Speaker 2: You can then train your pipeline directly from the command
- 24:06Speaker 2: line using spacey train.
- 24:07Speaker 1: And can you include a transformer in that pipeline for
- 24:11Speaker 1: text classification?
- 24:12Speaker 2: Yes, you can configure the pipeline to include a transformer component.
- 24:16Speaker 2: This component generates those context to wear embeddings we talked about,
- 24:19Speaker 2: which are then fit into the text categorizer. Often, adding
- 24:23Speaker 2: a transformer significantly boosts the accuracy of the classifier because
- 24:27Speaker 2: it has a richer understanding of the text's meaning and sentiment.
- 24:30Speaker 1: Okay, so let's name some names. What about famous transformer
- 24:33Speaker 1: models like Bert and Roberta? What makes them special?
- 24:37Speaker 2: Right? Bert bi directional encoder representations from transformers was a
- 24:41Speaker 2: huge step. Its key innovation was being bi directional during
- 24:45Speaker 2: pre training.
- 24:46Speaker 1: Meaning it looked forwards and backwards in the text simultaneously.
- 24:49Speaker 2: Yeah. Previous models were often unidirectional or combined separate left
- 24:54Speaker 2: to right and right to left models. Bert used a
- 24:56Speaker 2: technique called masked language modeling predicting hidden workds to learn
- 25:01Speaker 2: context from both directions at the same time. This gave
- 25:04Speaker 2: it a deeper understanding.
- 25:05Speaker 1: And it produced those dynamic word vectors.
- 25:08Speaker 2: Yes. It also used some special tokens like cls at
- 25:11Speaker 2: the beginning of sequences and stap to the separate sentences,
- 25:13Speaker 2: and it used word piece tokenization, breaking words into common
- 25:17Speaker 2: subword units like playing might become play and hashtag in.
- 25:21Speaker 2: This helps it handle large vocabularies and even words it
- 25:24Speaker 2: hasn't explicitly seen before.
- 25:25Speaker 1: What about Roberta? How did that improve on? Burt?
- 25:28Speaker 2: Roberta developed by Facebook AI basically took the Bert architecture
- 25:33Speaker 2: and optimized the training procedure. They used things like dynamic masking,
- 25:37Speaker 2: changing the masked words during training, trained on much more
- 25:41Speaker 2: data for longer, and removed one of Burd's training objectives
- 25:45Speaker 2: next sentence prediction finding. It didn't always help. These changes
- 25:49Speaker 2: generally led to better performance on downstream tasks compared to
- 25:52Speaker 2: the original Bert models.
- 25:53Speaker 1: Okay, so transformers are powerful pretrain models. What about the
- 25:57Speaker 1: even bigger ones, The large language models are llms? How
- 26:00Speaker 1: do they fit in?
- 26:01Speaker 2: Lms are essentially an evolution or maybe a scaling up
- 26:05Speaker 2: of those pre trained language models like bird. We're talking
- 26:08Speaker 2: models with vastly more parameters two three is one hundred
- 26:11Speaker 2: and seventy five billion, for instance, trained on absolutely enormous
- 26:14Speaker 2: amounts of text.
- 26:14Speaker 1: And code, and they can do well almost anything text related.
- 26:17Speaker 2: They're incredibly versatile. Yeah, translation, summarization, question answering, code generation,
- 26:22Speaker 2: creative writing. They've shown promise in specialized field like medicine,
- 26:26Speaker 2: law education too.
- 26:27Speaker 1: But they're not perfect, right, What are the downsides?
- 26:30Speaker 2: Definitely not perfect? There are key limitations. One is this
- 26:34Speaker 2: year computational cost training and even running them requires massive resources.
- 26:39Speaker 2: They can also be slower to generate responses compared to
- 26:41Speaker 2: smaller models, and crucially, they have this tendency to hallucinate.
- 26:46Speaker 1: Hallucinate meaning they mix stuff up.
- 26:49Speaker 2: Essentially, Yes, they can generate responses that sound perfectly plausible
- 26:52Speaker 2: and grammatically correct, but are factually incorrect or nonsensical. They
- 26:56Speaker 2: don't inherently know things. They're predicting probable sequences.
- 27:00Speaker 1: Of words, so you need to be careful how you
- 27:02Speaker 1: use them.
- 27:02Speaker 2: Very careful. A lot of work goes into prompt engineering,
- 27:06Speaker 2: carefully crafting the input prompt to guide the LLM towards
- 27:09Speaker 2: the desired accurate output.
- 27:11Speaker 1: How does space help manage interactions with llms.
- 27:14Speaker 2: There's a package called spacelm. It provides a structured way
- 27:17Speaker 2: to integrate llms into spacey workflows. It treats interactions with
- 27:21Speaker 2: an LM as defined tasks like summerization or entity.
- 27:25Speaker 1: Extraction, and it uses prompts.
- 27:26Speaker 2: Yes, it uses GINGA templates to define the prompts for
- 27:29Speaker 2: these tasks. You can use built in tasks, or you
- 27:31Speaker 2: can define your own custom tasks.
- 27:32Speaker 1: Custom tasks like what.
- 27:34Speaker 2: For example, the sources mentioned creating a custom task to
- 27:37Speaker 2: extract specific quotes from a text and the surrounding contact sentences.
- 27:42Speaker 2: You define the prompt template to ask the LLM for
- 27:45Speaker 2: this specific output, and you also define how to parse
- 27:48Speaker 2: the llm's potentially messy response back into a structured format
- 27:52Speaker 2: that Spacey can use.
- 27:54Speaker 1: So spacelm provides a bridge and some structure for using
- 27:58Speaker 1: llms within a more controlled space environment.
- 28:00Speaker 2: Exactly, it helps make using lllms more systematic and reproducible.
- 28:04Speaker 1: Let's circle back to training your own models. We talked
- 28:07Speaker 1: about NR. When would you actually need to train a
- 28:09Speaker 1: custom ANYR model instead of using a pre trained one.
- 28:12Speaker 2: That's a common question. The rule of thumb is, if
- 28:16Speaker 2: a pre trained Spacey model like Encore welding performs reasonably
- 28:20Speaker 2: well on your data, maybe gets say seventy five percent
- 28:23Speaker 2: accuracy or higher on the entities you care about, you
- 28:26Speaker 2: might not need full custom training.
- 28:27Speaker 1: What would you do then?
- 28:28Speaker 2: You could potentially find tune the existing model, or more often,
- 28:31Speaker 2: you'd use other Spacey components like the matcher or span ruler.
- 28:35Speaker 2: We discussed to add rules that catch the specific cases
- 28:38Speaker 2: the pre train model misses or gets wrong, kind of
- 28:41Speaker 2: like augmenting it.
- 28:42Speaker 1: But when is custom training unavoidable?
- 28:45Speaker 2: It's usually necessary when your domain has many important entity
- 28:50Speaker 2: types that are just completely absent from the pre trained models.
- 28:53Speaker 2: Think about highly specialized fields, specific financial instruments, unique biological
- 28:59Speaker 2: gene names, custom product codes very niche legal terms. If
- 29:03Speaker 2: the pre train model doesn't even know these categories exist,
- 29:06Speaker 2: rules alone won't cut it. You need to teach a
- 29:09Speaker 2: model from scratch or significantly fine tune one, and that.
- 29:12Speaker 1: Involves getting data and labeling it exactly.
- 29:15Speaker 2: Data collection is the first step. Then comes annotation, manually
- 29:19Speaker 2: labeling examples of your text with the entities, parts of speech, dependencies,
- 29:23Speaker 2: whatever your model needs to learn.
- 29:24Speaker 1: Are there tools for that? Annotation sounds tedious?
- 29:27Speaker 2: It can be, but there are great tools. Prodigy, also
- 29:30Speaker 2: from the makers of Spacey, is a very modern annotation
- 29:32Speaker 2: tool that often uses active learning to be more efficient.
- 29:35Speaker 2: It suggests labels you can firm or correct. They are
- 29:38Speaker 2: also open source options like Nertwig, which integrates with Jupiter Notebooks.
- 29:42Speaker 1: Okay, so you annotate your data using one of these tools,
- 29:44Speaker 1: then what then.
- 29:45Speaker 2: You convert that annotated data into Space's efficient binary format
- 29:49Speaker 2: doc ben. You typically split your data into training and
- 29:52Speaker 2: evaluation sets. Then you use Space's training system Spacey Trained
- 29:57Speaker 2: with a config file to train your custom and eer component,
- 30:01Speaker 2: and finally use spacey Evaluate to see how well your
- 30:04Speaker 2: trained model performs on the unseen valuation data.
- 30:07Speaker 1: What's fascinating here is the possibility of combining models. Can
- 30:12Speaker 1: you use your custom trained ner model alongside one of
- 30:16Speaker 1: Spacey's pre trained ones.
- 30:18Speaker 2: Yes, and that's often a very powerful approach. You get
- 30:20Speaker 2: the best of both worlds.
- 30:21Speaker 1: How does that work technically?
- 30:22Speaker 2: First, you'd package your custom trained pipeline component, maybe the
- 30:25Speaker 2: one that recognizes fashion brand entities, into an installable Python
- 30:29Speaker 2: package using the spacey package command.
- 30:31Speaker 1: Okay, so it's like distributing your own mini model exactly.
- 30:35Speaker 2: Then use another command, spacey assemble with a special configuration file.
- 30:39Speaker 2: This config file tells Spacey how to build a new
- 30:41Speaker 2: pipeline by sourcing components from different places.
- 30:44Speaker 1: So you could say, take my custom fashion brand component
- 30:46Speaker 1: and also take the GPE location and money components from
- 30:49Speaker 1: the standard encore webs as a model.
- 30:51Speaker 2: Precisely, Spacey assemble pulls these components together into a single,
- 30:56Speaker 2: unified a pipeline that can recognize entities from both your
- 31:00Speaker 2: custom training and the general purpose pre trained model. It's
- 31:04Speaker 2: a very neat way to create highly specialized, yet broadly
- 31:08Speaker 2: capable NLP systems.
- 31:10Speaker 1: Very cool. Let's touch on entity linking. That's about connecting
- 31:13Speaker 1: mentions in text to actual entries in a knowledge base
- 31:16Speaker 1: right disambiguating Washington.
- 31:18Speaker 2: Exactly is Washington referring to George Washington, the person, Washington, DC,
- 31:22Speaker 2: the city, or Washington state. Entity linking aims to resolve
- 31:26Speaker 2: that ambiguity by linking the mention to a unique identifier,
- 31:29Speaker 2: often in a knowledge base like Wikidata or a custom
- 31:32Speaker 2: company database.
- 31:33Speaker 1: How does space handle this?
- 31:34Speaker 2: Spacey has an entity linker component. It's architecture basically involved
- 31:38Speaker 2: three main parts. First, you need a knowledge base KB.
- 31:40Speaker 1: What's in the KB?
- 31:41Speaker 3: It stores information about the entities.
- 31:43Speaker 2: You want to link to their unique IDs like Wikidata qids, names, descriptions,
- 31:50Speaker 2: and aliases. Spacey provides tools to create this. For example,
- 31:54Speaker 2: and in memory lookup KB, you'd add entries for say,
- 31:57Speaker 2: Taylor Swift, the singer, Taylor Lautner, the act Taylor Fritz,
- 32:01Speaker 2: the tennis player, each with your unique ID and maybe
- 32:03Speaker 2: a short description.
- 32:04Speaker 1: What else is needed besides the KB?
- 32:07Speaker 2: Second, you need a way to generate candidate entities from
- 32:10Speaker 2: the KB. For a given mention in the text. If
- 32:13Speaker 2: the text says tailor, the system needs to know that Swift, Latner,
- 32:16Speaker 2: and Fritz are all potential candidates. You also add aliases
- 32:19Speaker 2: with prior probabilities. Maybe Taylor Swift the alias has a
- 32:23Speaker 2: one hundred percent probability of linking to the singer's ID,
- 32:26Speaker 2: while just Taylor has an equal chance for all three
- 32:28Speaker 2: initially and the third part. The third part is a
- 32:31Speaker 2: machine learning model which is trained to look at the mention,
- 32:33Speaker 2: its context in the sentence, and the information about the
- 32:36Speaker 2: candidate entities from the KB and then predict the most
- 32:39Speaker 2: likely correct link or predict nil if none of the
- 32:42Speaker 2: candidates seem right.
- 32:44Speaker 1: Does training this require special data?
- 32:46Speaker 2: Yes. When you train the entity linker component, your training
- 32:50Speaker 2: data needs to clearly specify which mentions should link to
- 32:54Speaker 2: which kb IDs. You often need a custom Corpus reader
- 32:58Speaker 2: to handle this specific data format during training.
- 33:00Speaker 1: Okay, we've built all these amazing models and pipelines. How
- 33:03Speaker 1: do we actually put them into the hands of users
- 33:06Speaker 1: or other systems. Let's talk deployment. Building apps in APIs right, moving.
- 33:10Speaker 2: From the lab to the real world. Two popular Python
- 33:14Speaker 2: frameworks are great for this, with spacey for building interactive
- 33:17Speaker 2: web applications quickly, especially for not a front end expert.
- 33:20Speaker 2: Streamlet is fantastic.
- 33:21Speaker 1: Streamlt How does it work?
- 33:23Speaker 2: It lets you build web apps purely in Python. You
- 33:25Speaker 2: can create widgets like textboxes that textavia and buttons very easily.
- 33:30Speaker 2: There's even a specific package Spacey streamlet that provides ready
- 33:34Speaker 2: made components to visualize Space's analysis like anyr results directly
- 33:38Speaker 2: in your streamlet app, so you.
- 33:40Speaker 1: Could build a quick demo tool for your Spacey pipeline exactly.
- 33:43Speaker 2: And a key feature is streamlets caching at ffon cash
- 33:47Speaker 2: or at s don cash data. This prevents your Spacey
- 33:50Speaker 2: models from having to reload every single time a user
- 33:53Speaker 2: interacts with the app, which makes it much faster and
- 33:56Speaker 2: more responsive.
- 33:56Speaker 1: What if you need something more robust, like a back
- 33:59Speaker 1: end API that other services can call.
- 34:01Speaker 2: Then fastpi is an excellent choice. It's a modern, high
- 34:04Speaker 2: performance Python framework specifically designed for building APIs.
- 34:09Speaker 1: What makes fast to PI good.
- 34:10Speaker 2: It's known for its speed. It also leverages Python type
- 34:14Speaker 2: hints heavily. You define the expected data types for your
- 34:17Speaker 2: API inputs and outputs, which faster PI uses for automatic
- 34:20Speaker 2: data validation, gadging errors early, and also for automatically generating
- 34:24Speaker 2: interactive API documentation using Swagger UI.
- 34:27Speaker 1: So it makes development faster and more reliable.
- 34:29Speaker 2: Yes, significantly, you use pidanic models to define your data
- 34:33Speaker 2: structures and faster PI handles the validation and serialization. You
- 34:38Speaker 2: could easily build an API in point that takes some text,
- 34:41Speaker 2: runs it through your spacey ner pipeline, and returns the
- 34:44Speaker 2: extracted entities as structured Jason data. The autogenerated documentation makes
- 34:49Speaker 2: it super easy for others or yourself to understand and
- 34:52Speaker 2: test the API.
- 34:53Speaker 1: Okay, building models, deploying apps, the whole process can get complex.
- 34:58Speaker 1: How do you manage the entire end to end workflow,
- 35:01Speaker 1: especially for reproducibility and collaboration.
- 35:03Speaker 2: That's where workflow management tools come in. Spacey has a
- 35:06Speaker 2: companion tool called Weasel. Weasel Yeah, Weasel helps you structure
- 35:09Speaker 2: your entire NLP project. You define your workload steps like
- 35:13Speaker 2: downloading data, preprocessing, training, evaluating, along with any data assets
- 35:17Speaker 2: and custom commands, all within a configuration file project dot EML.
- 35:21Speaker 2: It makes your project reproducible and easier for others to
- 35:24Speaker 2: understand and run.
- 35:25Speaker 1: What about managing the data itself and the models? They
- 35:28Speaker 1: can get large and change often for that.
- 35:31Speaker 2: Data Version controlled DVC is an increasingly popular tool, especially
- 35:35Speaker 2: in the mL world. It works alongside geit. How does
- 35:38Speaker 2: DVC help it tackles several common problems. First, sharing large
- 35:42Speaker 2: data sets and models is hard with get alone, DVC
- 35:45Speaker 2: lets you version your data end models, storing them in
- 35:48Speaker 2: remote storage like s three year Google Cloud storage, while
- 35:52Speaker 2: keeping small metaphiles in GIT. This makes collaboration much easier.
- 35:56Speaker 2: What else, it helps make your data processing and model
- 35:58Speaker 2: training pipelines relyable and reproducible. You define the steps and
- 36:02Speaker 2: their dependencies, and DVC can tract everything. It also crucially
- 36:06Speaker 2: helps with tracking model metrics over time, so you can
- 36:09Speaker 2: see how performance changes as you modify data or code.
- 36:12Speaker 2: It really embraces giops principles for mlops, making your mL
- 36:16Speaker 2: workflows version, automated and continuously reconciled.
- 36:20Speaker 1: So it brings better engineering practices to data science exactly.
- 36:23Speaker 2: It helps manage the whole life cycle, and tools like
- 36:25Speaker 2: DVC studio even provide features like a model registry for
- 36:28Speaker 2: managing and sharing your train models effectively across a team.
- 36:31Speaker 2: Weasel and DVC together provide a really solid foundation for
- 36:34Speaker 2: managing serious NLP projects.
- 36:36Speaker 1: Wow from the core concepts and pipeline through advanced analysis
- 36:41Speaker 1: like dependency parsing and NR rule based matching, transformers LMS,
- 36:46Speaker 1: training custom models, and finally, deployment and workflow management. That
- 36:51Speaker 1: was an incredibly thorough deep dive into the Spacey ecosystem.
- 36:55Speaker 2: It really covers a lot of ground, doesn't it.
- 36:56Speaker 1: It absolutely does. It really reinforces that idea of space
- 37:00Speaker 1: see being that practical, well optimized kitchen knife, precise, powerful
- 37:05Speaker 1: and adaptable for so many different NLP tasks.
- 37:08Speaker 2: Yeah. And you know, if we connect this to the
- 37:09Speaker 2: bigger picture, really understanding tools like Spacey empowers you not
- 37:14Speaker 2: just to build things, but also to critically evaluate how
- 37:17Speaker 2: these language AI systems work, how they understand or misunderstand
- 37:20Speaker 2: the world.
- 37:20Speaker 1: That's a great point.
- 37:21Speaker 2: It kind of raises an important question for anyone listening.
- 37:23Speaker 2: I think, now that you have this deeper insight, how
- 37:25Speaker 2: will you use this knowledge, maybe to refine your own analysis,
- 37:28Speaker 2: or perhaps even to build something new and impactful.
- 37:31Speaker 1: A fantastic thought to end on. We definitely encourage you,
- 37:34Speaker 1: our listeners, to keep exploring these fascinating topics and think
- 37:38Speaker 1: about how you might apply this knowledge, whether it's in
- 37:40Speaker 1: your work, your studies, or just your own curiosity about
- 37:44Speaker 1: language and AI.