Remote NLP Study Group meets Saturdays at 8 AM PST, starting 12/14/2019

Sorry I didn’t understand – what starts next week?

getting an error in 3-logreg-nb-imdb with this cell in colab

m = LogisticRegression(C=0.1, dual=True)
m.fit(x, y.items.astype(int))
preds = m.predict(val_term_doc)
(preds==val_y).mean()

first error i got was

ValueError: Solver lbfgs supports only dual=False, got dual=True

so i naively set to False, since per the docs, that sounds like the right thing to do anyways

https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html

which is when i get a very different error

/usr/local/lib/python3.6/dist-packages/sklearn/linear_model/_logistic.py:940: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.

Increase the number of iterations (max_iter) or scale the data as shown in:
    https://scikit-learn.org/stable/modules/preprocessing.html
Please also refer to the documentation for alternative solver options:
    https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
  extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG)
0.655

@jcatanza have you seen this error?

Hi @foobar8675
I obtained good results with the liblinear and newton-cg solvers. The other solvers got poorer results and failed to converge.

1 Like

Hi all. Due to a family emergency, I must cancel today’s (Saturday 1/18) NLP class. The class will resume next week as usual.

The good news is that I have refactored and annotated the 3-logreg-nb-imdb.ipynb notebook and pushed it to github here https://github.com/jcatanza/Fastai-A-Code-First-Introduction-To-Natural-Language-Processing-TWiML-Study-Group/blob/master/3-logreg-nb-imdb_jcat.ipynb

3-logreg-nb-imdb_jcat.ipynb is a self-contained tutorial on Naive Bayes and Logistic Regression applied to the IMDb data. I think you’ll find it useful!

Today’s assignment: please get the 3-logreg-nb-imdb_jcat.ipynb notebook and use the 1.5 class hours to read, run, play with, and learn from it!

Have a great weekend, and I’ll see you next week.

that makes sense. thanks!

The Fastai NLP Study Group will meet
Saturday January 25, at 8 AM PST, 11 AM EST, 5 PM CET, 9:30 PM IST

Join the Zoom Meeting when it’s time!

Topic: Sentiment Classification with Naïve Bayes and Logistic Regression

Suggested homework / preparation:

  1. Watch video #5; Video playlist is here

  2. Read and work through my extensively refactored and annotated version of the 3-logreg-nb-imdb.ipynb notebook

  3. Note: in order to run my version of the notebook you’ll need to fork or clone the study group repository

To join via Zoom phone
Dial US: +1 669 900 6833 or +1 646 876 9923
Meeting ID: 832 034 584

The current meetup schedule is here.

Sign up to receive meetup announcements via email.

You can read (but not run) the notebook for this week’s discussion in nbviewer.

@jcatanza I get a 404 when I click the link on #2. :frowning:

1 Like

Thank you @foobar8675, good catch. It’s fixed now!

@jcatanza i started looking a head to video 8 and am a bit torn on using the fastai v1 library since v2 is coming soon. Do you have any thoughts on that?

Notes from the Saturday 1/25/2020 meetup discussing the notebook 3-logreg-nb-imdb_jcat.ipynb

  1. In order to get the notebook to produce the table of accuracies at the end, you have to first install the tabulate package: in a shell terminal window, run the command:
    conda install tabulate

  2. I added a brief discussion of Bayes’ Theorem to the notebook.

I think you should press on using the v1 library. My feeling is that familiarizing with v1 will ultimately make it easier to learn v2.

The Fastai NLP Study Group will meet
Saturday February 01, at 8 AM PST, 11 AM EST, 5 PM CET, 9:30 PM IST

Join the Zoom Meeting when it’s time!

Topics: Fun with Bayes' Theorem; Numerical Stability; regex (regular expressions)

Suggested homework / preparation:

  1. Watch videos #6 and #7. These two videos are relatively short (about an hour total). The lesson will focus mainly on video #7: regex (regular expressions).

Video playlist is here

  1. Read and work through notebooks 3b-more-details_jcat.ipynb and 4-regex_jcat.ipynb

  2. Note: in order to access and run the _jcat.ipynb notebooks you’ll need to clone the Study Group’s github repository >

To join via Zoom phone
Dial US: +1 669 900 6833 or +1 646 876 9923
Meeting ID: 832 034 584

The current meetup schedule is here.

Sign up here to receive meetup announcements via email.

Thank you @jcatanza. I’m still a bit torn but appreciate your thoughts.

@foobar8675 Have you installed Fastai v1?

Yes, I have.

1 Like

The Fastai NLP Study Group will meet

Saturday February 08, at 8 AM PST, 11 AM EST, 5 PM CET, 9:30 PM IST

Join the Zoom Meeting when it’s time!

Topic: Introduction to Language Modeling using Deep Learning

Suggested preparation:

  1. Watch video #8 Video playlist is here

  2. Read and work through course notebook #5

In this reworked and annotated version of notebook 5-nn-imdb.ipynb, I

  • Fixed a few minor errors, enabling the notebook to run to completion
  • Implemented a workaround for a bug in fastai's text data API that seems to affect only Windows 10
  • Organized the material into coherent sections
  • Added step-by-step explanations/annotations throughout, indicating where transfer learning comes into play.
  1. Note: in order to access and run the _jcat.ipynb notebooks you’ll need to clone our Study Group’s github repository.

To join via Zoom phone
Dial US: +1 669 900 6833 or +1 646 876 9923
Meeting ID: 832 034 584

The current meetup schedule is here.

Sign up here to receive meetup announcements via email.

The Fastai NLP Study Group will meet
Saturday February 22, at 8 AM PST, 11 AM EST, 5 PM CET, 9:30 PM IST

Join the Zoom Meeting when it’s time!

Topic: ULMFit for non-English Languages

Suggested preparation:

  1. Watch video #10
    Video playlist is here
  2. Read and work through these course notebooks
    nn-imdb-more_jcat.ipynb ,
    nn-vietnamese_jcat.ipynb , and
    nn-turkish_jcat.ipynb

Note: in order to access and run the _jcat.ipynb notebooks you’ll need to clone our Study Group’s github repository.

To join via Zoom phone
Dial US: +1 669 900 6833 or +1 646 876 9923
Meeting ID: 832 034 584

The current meetup schedule is here.

Sign up here to receive meetup announcements via email.

Can you share some links for better understanding basics of pytorch…

@Shefs0709

I would start with these two resources

This would get you going. Good Luck!! Happy Learning.