Show HN: Natural Language Processing Demystified
Hi HN:
After a year of work, I've published my free NLP course. The course helps anyone who knows Python and a bit of math go from the basics to today's mainstream models and frameworks.
I strive to balance theory and practice, so every module consists of detailed explanations and slides along with a Colab notebook putting the ideas into practice (in most modules).
The notebooks cover how to accomplish everyday NLP tasks including extracting key information, document search, text similarity, text classification, finding topics in documents, summarization, translation, generating text, and question answering.
The course is divided into two parts. In part one, we cover text preprocessing, how to turn text into numbers, and multiple ways to classify and search text using "classical" approaches. And along the way, we'll pick up valuable bits on how to use tools such as spaCy and scikit-learn.
In part two, we dive into deep learning for NLP. We start with neural network fundamentals and go through embeddings and sequence models until we arrive at transformers and the mainstream models of today.
No registration required: https://www.nlpdemystified.org/
38 comments
[ 4.6 ms ] story [ 86.1 ms ] thread“I didn't have time to write a short letter, so I wrote a long one instead.” [1]
[1] https://www.goodreads.com/quotes/21422-i-didn-t-have-time-to...
Do you record the voice track of your videos yourself?
Glad to see you published the final lesson about transformers. Was looking forward to that!
Hope you find the transformers module useful!
Blaise Pascal, 1656
FYI
Along the way, I've been struggling with a question and I hope someone can help me understand how to go about this: how would you build a model that does more than one NLP task? For a simple classifier like input: text (a tweet) and output: text (an emotion), you can fine-tune an existing classifier on such a data set. But, how would you build a model that does NER and sentiment analysis? E.g. input: text (a Yelp review of a restaurant) and output: list of (entity, sentiment) tuples (e.g. [("tacos", "good"), ("margaritas", "good"), ("salsa", "bad")]). If you have a data set structured this way, and want to fine-tune a model, how does that model know how to make use of a Python list of tuples?
Or maybe skip all that and outsource it to GPT: https://imgur.com/a/BQv6C3K
You just need to create [(input, output)] examples in the format you want.
For example
[(a Yelp review of a restaurant, [("tacos", "good"), ("margaritas", "good"), ("salsa", "bad")]].
With enough data, the model should be able to learn to generate the output in the right format.
> Python list of tuples
Things get interesting if you want to generate actual Python code. You can use a large language model with just a few examples of the task to generate such code. For example, see https://reasonwithpal.com/.
Happy to answer more questions!
[1] https://huggingface.co/docs/transformers/model_doc/t5
[2] https://colab.research.google.com/github/huggingface/noteboo...
[1] http://essay.utwente.nl/91778/1/Middelraad_BA_EEMCS.pdf
https://news.ycombinator.com/newsguidelines.html
Secondly kudos for not requiring a sign up and for making it free!
Looks like a brilliant resource, thank you.
So the ideal outcome is someone who gets an end-to-end view from theory/concept to implementation.
If someone just wants to learn how to use tools/frameworks, I'd stick to the Colab notebooks. If someone's already experienced in ML and wants to learn something NLP-specific, I'd skip around to see what's interesting.
[0] https://en.wikipedia.org/wiki/Nonlinear_programming
I really love that you build a complete working example, all the way down to the matrix multiplications, so that we can see how everything works, at every layer of abstraction.
I'm looking forward to the next unit, and I can already tell this is going to be an indispensable reference I'll come back to review again and again.
Thank you!!
anyway, thanks for the submission