![Applied Language Technology](/img/default-banner.jpg)
- 63
- 116 281
Applied Language Technology
Finland
Registrace 8. 12. 2020
CZcams channel for Applied Language Technology courses at the University of Helsinki, Finland.
Universal Dependencies and evaluation
In this video, I discuss how models trained using Universal Dependencies treebanks are evaluated.
✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html
✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-Technology/notebooks
✨ Check out other videos in the Natural Language Processing for Linguists playlist: czcams.com/play/PL6cQi6qFlek0LQ_6gz2cCksbLhE1PfX4R.html
✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html
✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-Technology/notebooks
✨ Check out other videos in the Natural Language Processing for Linguists playlist: czcams.com/play/PL6cQi6qFlek0LQ_6gz2cCksbLhE1PfX4R.html
zhlédnutí: 786
Video
Exploring syntactic dependencies using spaCy
zhlédnutí 1,4KPřed 2 lety
In this video, I provide a brief introduction to modifiers, which are one of the three phrasal units defined in the Universal Dependencies framework. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.c...
Modifiers in the Universal Dependencies framework
zhlédnutí 358Před 2 lety
In this video, I provide a brief introduction to modifiers, which are one of the three phrasal units defined in the Universal Dependencies framework. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.c...
Clauses in the Universal Dependencies framework
zhlédnutí 587Před 2 lety
In this video, I provide a brief introduction to clauses, which are one of the three phrasal units defined in the Universal Dependencies framework. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com...
Nominals in the Universal Dependencies framework
zhlédnutí 584Před 2 lety
In this video, I provide a brief introduction to nominals, which are one of the three phrasal units defined in the Universal Dependencies framework. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.co...
Basic linguistic assumptions behind Universal Dependencies
zhlédnutí 813Před 2 lety
In this video, I shortly describe some of the basic linguistic assumptions behind the Universal Dependencies framework. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-Technology...
A short introduction to Universal Dependencies
zhlédnutí 1,6KPřed 2 lety
In this video, I provide a short overview of Universal Dependencies as a framework and a project. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-Technology/notebooks ✨ Check out...
Named Entity Recognition (NER) using spaCy
zhlédnutí 3KPřed 2 lety
In this video, I show you how to do named entity recognition using the spaCy library for Python. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_ii/02_basic_text_processing_continued.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-Technology/notebooks ✨ Ch...
Reading and writing text using Path objects
zhlédnutí 407Před 2 lety
In this video, I show you how to read and write text using Path objects in Python. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_ii/02_basic_text_processing_continued.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-Technology/notebooks ✨ Check out other ...
Working with files and directories using pathlib
zhlédnutí 985Před 2 lety
In this video, I show you how to use the pathlib module in Python to work with files and directories. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_ii/02_basic_text_processing_continued.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-Technology/notebooks...
Manipulating text in Python: replacing patterns using a for loop
zhlédnutí 3,1KPřed 2 lety
In this video, I will show you how to create a for loop to replace character sequences in Python. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_ii/01_basic_text_processing.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-Technology/notebooks ✨ Check out o...
Manipulating text in Python: join a list into a string
zhlédnutí 553Před 2 lety
In this video, I will show you how to join a Python list into a string using the "join" method. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_ii/01_basic_text_processing.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-Technology/notebooks ✨ Check out oth...
Manipulating text in Python: replace, split and pop
zhlédnutí 947Před 2 lety
In this video, I will show you how to use the "replace", "split" and "pop" methods to manipulate string and list objects in Python. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_ii/01_basic_text_processing.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-Language-...
Loading text into Python
zhlédnutí 913Před 2 lety
In this video, I will show you how to load a plain text file into Python using the "open" function in combination with the "with" statement. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_ii/01_basic_text_processing.html ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub: github.com/Applied-...
Grouping spaCy Spans into a SpanGroup
zhlédnutí 1,8KPřed 3 lety
In this video, I show you how to group spaCy Span objects into a SpanGroup, and how to add custom attributes to the Spans within. ✨ Check out the learning materials associated with this video: applied-language-technology.mooc.fi/html/notebooks/part_iii/06_text_linguistics.html#adding-information-on-sentence-mood ✨ Clone the repository with Jupyter Notebooks for interactive computing from GitHub...
Parsing CoNLL-U annotations using Python
zhlédnutí 3,6KPřed 3 lety
Parsing CoNLL-U annotations using Python
Introduction to the CoNLL-U annotation schema
zhlédnutí 2,8KPřed 3 lety
Introduction to the CoNLL-U annotation schema
Visualising word embeddings in spaCy using whatlies
zhlédnutí 987Před 3 lety
Visualising word embeddings in spaCy using whatlies
Introduction to word embeddings in spaCy
zhlédnutí 3,3KPřed 3 lety
Introduction to word embeddings in spaCy
Training a neural network for learning word embeddings
zhlédnutí 645Před 3 lety
Training a neural network for learning word embeddings
Creating a neural network for learning word embeddings
zhlédnutí 819Před 3 lety
Creating a neural network for learning word embeddings
Preparing the data for learning word embeddings
zhlédnutí 593Před 3 lety
Preparing the data for learning word embeddings
Exploring the distributional hypothesis from a paradigmatic perspective
zhlédnutí 358Před 3 lety
Exploring the distributional hypothesis from a paradigmatic perspective
Exploring the distributional hypothesis from a syntagmatic perspective
zhlédnutí 598Před 3 lety
Exploring the distributional hypothesis from a syntagmatic perspective
Introduction to the distributional hypothesis
zhlédnutí 1,5KPřed 3 lety
Introduction to the distributional hypothesis
Matching syntactic dependencies using spaCy DependencyMatcher
zhlédnutí 3,9KPřed 3 lety
Matching syntactic dependencies using spaCy DependencyMatcher
Matching morphological features using spaCy Matcher
zhlédnutí 2,1KPřed 3 lety
Matching morphological features using spaCy Matcher
Defining pattern rules for spaCy Matcher
zhlédnutí 6KPřed 3 lety
Defining pattern rules for spaCy Matcher
Exactly what I was looking for, thanks!
how can documents be encapsulated/embedded (in analogy to "include" in LaTex)?
thank you!
You're welcome!
Incredible! Thank you for sharing this.
You're welcome!
Hello, teacher! I am having some trouble with an issue that has arisen during the submission of the Stanza model for the 'part_01-stanza_basics' test. Although all 20 tests have passed successfully when running locally, I am encountering difficulty upon submitting the model to the server. It appears that the system is unable to locate the required language model. An error message is displayed saying, "Resources file not found at: ../stanza_models/resources.json. Try to download the model again." If I'm running the notebook on a local machine, could the default model directory perhaps not be recognized by the TMC server? What should I do to solve this issue, I eagerly await your guidance, Thank you!
Hello Sir, does the "Token" is a variable value you chose it or reserved word in spaCy library ?
Hey @MrNadir, it is not reserved by the spaCy library!
Basically, here you just casually recreated the core idea of word2vec using skip-gram model in a very simple and understandable way 👏Well done!
You saved my week!!!!! Its exactly what I was looking for!
Happy you found the video helpful!
Thank you for your useful video. Do you know how to split long text into paragraphs?
Hi @tiny8999 there is no ready-made component for "paragraph segmentation" in spaCy, but you could try looking for two line breaks or a tab character in your document to identify the paragraph breaks?
Very clear explanation! One quick question: This would require that a text has already been sentence segmented. Is there a way to pass a whole textual file to Stanza and use its sentence splitting functionality without resorting to third party tools?
Hey @haiyangai6057! A good question ... you could try providing your document to Stanza and disable all other components except tokenization and sentence segmentation. However, even if your documents are longer, you should be able to speed up the process by providing them to Stanza in a list for batched processing.
You can also pass a list of strings, of which each string consists of multiple sentences: ["This is the first text. It contains mjltiple sentences.", "And this is the second. Also multiple sentences."] The stanza tokenizer will perform sentence segmentation.
So yes, you can pass in a whole text document by reading it in as one single string.
a question. Is helsinki delivering mooc certificate for this course?
Yes, as soon as we can sort out access to the learning environment for all users! The course should be open to everyone around the turn of 2023/2024!
great series on NLP. Thank you!
Glad you like them!
God bless these people.
I take that as a compliment. :-)
This is very neatly and clearly put!
Thanks! Great to see more linguistics content on CZcams!
Can you also add custom attributes to tokens?
Hi @seanosuilleabhainemerald, yes, check out the details here: spacy.io/api/token#set_extension
with SpaCY can you input a String of words and have it return all of the morphemes that are present?
Hi @brandongolub4454, unfortunately this kind of "morpheme-level" tokenization is not possible!
great explanation, thanks 👍
Glad it was helpful!
it is a nice talk! but why the code sometimes doesn't work out, and sometimes works
Thanks! Could you be a bit more specific? Does the code raise an error?
Very good lesson. I like that you explain clearly and slowly.
Glad you liked it!
thanks for video! it is really helpful!
Glad you found it useful!
"We discussed the risks of chemotherapy on 1-17-1970" how can we find the relation between chemotherapy and 1-17-1970 ?
One solution would be to create several example sentences such as the one you mentioned, before parsing them with spaCy! This gives you an idea of the linguistic patterns that should be captured by the syntactic Matcher.
Nice explaination style!
Glad you liked it!
hey ! nice video, i have a little question tho : if i dowloaded the stanza model on huggingface how do i use it in the pipeline after that ?
Hey! You can find some instructions here: huggingface.co/docs/hub/stanza If you have the model somewhere else than the default directory, use the "dir" parameter when initialising a Pipeline, e.g. nlp = stanza.Pipeline(lang='en', dir='path/to/your/directory')
Hi,, i wanna ask,, how about audio file? not just text file?
Hi Rizki! This video is about techniques for working with multiple files - it does not matter what their type is!
How does this work for tokens? Say I have: a = "Daniel" and I want to check if it's a name. nlp = spacy.load("en_core_web_sm") doc = nlp(a) print(doc[0].ent_label_) does not work neither does for ent in doc.ents: print(ent.text, ent.start_char, ent.end_char, ent.label_)
Hey! No, annotations for named entities are stored into Doc objects, because they often span multiple Token objects. Always check if the model has actually located any named entities, e.g. import spacy nlp = spacy.load('en_core_web_sm') doc = nlp("Paris") print(doc.ents) If no named entities are detected, spaCy will return an empty tuple!
Thank you for making this video, really
Glad you found it useful!
Thank you very much. Amazing ! Is this distance between embedding are based on euclidean distance?
You're welcome! In this case, it's cosine distance!
Thank you for sharing this opportunity to learn!
the playlist seems to be designed for beginners but i was lost when u te instructor started talking about universal dependencies, coarse and fine-grained pos tags
Hey @Dormadum, remember that the videos are to be used in connection with the learning materials, which help to clarify the concepts: applied-language-technology.mooc.fi/
Great video, thanks a lot! Would be possible to share '.ipynb' file?
Hey! You can find all notebooks here: github.com/Applied-Language-Technology/notebooks
I was looking for a good video to share with a colleague to explain this concept in spaCy. This was fantastic, as always! Thanks so much.
Do you know how can I do this but for an specific sentence in the paragraph?
Using spaCy? See the video here for how to extract sentences from longer pieces of text: czcams.com/video/NknDZSRBT7Y/video.html
Hi does this works if I have a word file?
Maybe you can use regular expressions, but you cannot process Word files using Python.
Hi, do you know how can I do this for a pdf file ?
No, you need to extract plain text from the PDF first.
@@AppliedLanguageTechnology how do I do that with python?
Google is your friend, there are plenty of alternatives.
when I search for this in google, they think I am looking por .pdf file book. If you have any link please share :(
I have many documents (that scraped from PDF files) should I pass all this documents as one text into nlp object to get common vector representation, or it's ok to pass each document and get each vector representation separately?
Hi! I don't know how long your documents are, but passing them to a language model will give you one vector per token. You can access a vector representation for the entire Doc object through the attribute "vector", but please note that these representations are likely to become diluted if the Doc is very long. For a better alternative, you should look at algorithms such as Doc2Vec.
Hi there. Thanks so much for your great videos. A question regarding attributes and spaCy classification models. Does custom attributes influence text classification model predictions? In other words, let's say I create custom attributes on some docs that I am using for training. Let's assume that those attributes can help in recognizing the categories I want to predict. Are those custom attributes used by spaCy at the moment of generating predictions? Many thanks for your guidance.
Hi Paola, yes, if you teach the model to predict those attributes during training - you can find an example in another repo of mine, which predicts labels for Span objects: github.com/thiippal/MoodCat
@@AppliedLanguageTechnology Awesome. Thank you very much for your guidance and for providing an example.
Hi Tuomo. I have started implementing the spancat, but I am getting to some issues with the labeling, which means maybe my Example object have some problem. I have set up a question in Stack Overflow. I am sharing it here in case you can give me some light. You are the more knowledgeable person I know about spaCy. Thank you so very much in advance.
How do we know best match pattern
Hi! Can you be a bit more specific? If you're looking to define a pattern that provides the best matches, then the answer is to study your data! There is no one-stop solution.
Thank you for sharing. I have a question though. If I want to extract the compound object of a sentence, but there are more than one compound token for the object, how should I do it?
Hi Shane! Check out the materials here: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html#exploring-syntactic-dependencies-using-spacy Because the dependency relation points towards the head word (e.g. object), you can use the attributes of the Token object to retrieve the subtree.
Great Video !!!
Hi. I have enjoyed and learn from your videos so much. Thanks for all the love you have given in all those series of notebooks. I have a question regarding the inclusion of embedding in a pipeline. If I understand correctly, the 300-dimentional mapping that is made from tokens is a powerful alternative to applying other preprocessing methods such as TfidfVectorizer. For TfidfVectorizer I have a .fit() method that allows me to include it easily in a pipeline. Is there something equivalent (with an fit() method) for applying the mapping included in the nlp_lg() function? Is it OK to take that mapping and applying directly to my tokens? I am looking to apply embedding as preprocessing of tokens in a Logistic regression model. Many thanks for your feedback.
Hi Paola! I assume you want to use scikit-learn for the logistic regression model? In that case, you need to think about the whole pipeline: use spaCy for tokenization (and perhaps removal of stopwords), which gives you the input to tf-idf vectorizer. Adding the tf-idf vectors to the spaCy Tokens would simply complicate things, as the final model will be in scikit-learn anyway!
Best tutorial on such a complex topic.
Thanks!
Once you created your pattern and get dependency matches back, is there a way to get all the sentences in which there matches were found back?
Sorry for the belated reply (on holiday)! Sure: get the Token indices for matches, then get the indices for the sentences using the start and end attributes, and see if the Token indices fall within the range.
Actually, you can also check if a Token is contained within a Span (e.g. a sentence under Doc.sents) using the following expression: Token in Span, which will return a Boolean. You could loop over the Tokens returned by the DependencyMatcher and return the sentence at the index that has the value True.
thanks for a nice tutorial. is there any opportunity to customize a DependancyMatcher to recognize complex subjects or objects (consisting of 1 < tokens ) ?
Yep, because the dependency relation will point towards the head of a phrasal unit, you can use spaCy's Token-level attributes to fetch the dependents of that head: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html#exploring-syntactic-dependencies-using-spacy
Great video, thank you. I have a question, I am looking for phrases of the specific patterns, is there a way to determine whether founded phrases belong to subject or object in the sentence? Thank you.
Hi Ildar! Yes, but you will have to use the DependencyMatcher - I have a video here: czcams.com/video/gUbMI52bIMY/video.html
Great video! Question: how do you incorporate this to pass a large data frame through this code? I’ve tried creating a function incorporating your code but it either errors or outputs incomplete patterns. Thanks in advance and look forward to more training videos!!
Hi Robby! I assume you have created a DependencyMatcher that contains the pattern that you want to match, and your data is in a pandas DataFrame? Create the DependencyMatcher object first, and then use the "apply" function with a lambda function to apply the matcher, e.g. df['matches'] = df['text'].apply(lambda x: matcher(x)) This code stores the result into a new colun named "matches".
Thank you! For the solution as well as the quick response. If I may ask another, since optional operators are not allowed in dep matcher, is there a work around to incorporate multiple patterns? The records I’m searching have the verb-noun as a dobj and other sentence structures it’s an amod. There are also cases where 0 or more compounds are needed. I was thinking I may have to run the first pattern then the other patterns without overwriting; I can research that option. But am curious if you are aware of another method. Again thank you for sharing your knowledge
Hi again, happy to hear that you solved the problem! As for the second question, I think the most optional solution is to define a single DependencyMatcher and then add multiple patterns to the same matcher. Also remember that the DependencyMatcher returns indices of Token objects - you could, for, example, retrieve the dependents of those Tokens before applying a normal Matcher to that Span. For more information on exploring the dependencies, see: applied-language-technology.mooc.fi/html/notebooks/part_iii/02_universal_dependencies.html#exploring-syntactic-dependencies-using-spacy
Awesome tutorial again! Very helpful! Short question but not directly related to this video, do you plan to create a tutorial for the hugging face transformer interface of spaCy?
Hey! I've been thinking about creating some advanced content in the future, such as training spaCy models. What would you like to learn about interfacing HuggingFace with spaCy?
@@AppliedLanguageTechnology Hey!, I think it would be very interesting to see how to use a transformer model, and then for example fine-tune it with new entity types. Or for a second tutorial to train a transformer model from scratch (if that is even possible with spacy).
This video helped me tremendously. Thanks!
Glad you found it useful!
Awesome content, on point, simple to understand, well documented. Well done!
Thank you so much!
Nice Video
Hi, what is the real purpose of using the JupyterLab notebook for development? Isn't just increase the burden into the laptop. Why not just install all the necessary tools and have a go
Good question! Keep in mind that these materials are intended for beginners, who may not have the skills to install the required libraries and may also find an IDE intimidating. For this audience, I think the Notebooks are a perfect choice, because they allow executing the code step-by-step. For actual development, I would naturally recommend getting familiar with an IDE such as Spyder or PyCharm.
@@AppliedLanguageTechnology Cool answer - make sense. Good for kids then BUT for adult ... it's more like an embarrassing for not knowing how to install/use the dev IDE. A self insulting attitude