GithubHelp home page GithubHelp logo

nlp-in-python-tutorial's People

Contributors

adashofdata avatar antouank avatar woyeso avatar wptff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nlp-in-python-tutorial's Issues

ymin and ymax in Matplotlib are deprecated

Context

I went through this tutorial on 2019-07-07 with vanilla installs of recommended software applications and updates on a Windows 10 Home x64 machine and encountered a deprecation warning when running 3-Sentiment-Analysis.ipynb in the jupyter notebook.

Issues

The ymin argument was deprecated in Matplotlib 3.0 and will be removed in 3.2.
The ymax argument was deprecated in Matplotlib 3.0 and will be removed in 3.2.

Solution

Update code in 3-Sentiment-Analysis.ipynb from original:

plt.ylim(ymin=-.2, ymax=.3)

to

# plt.ylim(ymin=-.2, ymax=.3) (deprecated)
plt.ylim(bottom=-.2, top=.3)

dtm_stop.

dtm_stop.pkl , how you created it , I am getting error in that

I'm returning an empty list after scraping texts from the url !

Hi,

I would like to know what went wrong in the below code. I'm supposed to get a list of texts from the transcripts that were scrapped from the below urls. But all I get is an empty list. Any help would be much appreciated !

The code:

`def url_to_transcript(url):
'''Returns transcript data specifically from scrapsfromtheloft.com.'''
page = requests.get(url).text
soup = BeautifulSoup(page, "lxml")
text = [p.text for p in soup.find(class_="elementor-widget-container").find_all('p')]
print(url)
return text

URLs of transcripts in scope

urls = ['http://scrapsfromtheloft.com/2017/05/06/louis-ck-oh-my-god-full-transcript/',
'http://scrapsfromtheloft.com/2017/04/11/dave-chappelle-age-spin-2017-full-transcript/',
'http://scrapsfromtheloft.com/2018/03/15/ricky-gervais-humanity-transcript/',
'http://scrapsfromtheloft.com/2017/08/07/bo-burnham-2013-full-transcript/',
'http://scrapsfromtheloft.com/2017/05/24/bill-burr-im-sorry-feel-way-2014-full-transcript/',
'http://scrapsfromtheloft.com/2017/04/21/jim-jefferies-bare-2014-full-transcript/',
'http://scrapsfromtheloft.com/2017/08/02/john-mulaney-comeback-kid-2015-full-transcript/',
'http://scrapsfromtheloft.com/2017/10/21/hasan-minhaj-homecoming-king-2017-full-transcript/',
'http://scrapsfromtheloft.com/2017/09/19/ali-wong-baby-cobra-2016-full-transcript/',
'http://scrapsfromtheloft.com/2017/08/03/anthony-jeselnik-thoughts-prayers-2015-full-transcript/',
'http://scrapsfromtheloft.com/2018/03/03/mike-birbiglia-my-girlfriends-boyfriend-2013-full-transcript/',
'http://scrapsfromtheloft.com/2017/08/19/joe-rogan-triggered-2016-full-transcript/']

Comedian names

comedians = ['louis', 'dave', 'ricky', 'bo', 'bill', 'jim', 'john', 'hasan', 'ali', 'anthony', 'mike', 'joe']`

.nonzero() is deprecated

Context

I went through this tutorial on 2019-07-06 with vanilla installs of recommended software applications and updates on a Windows 10 Home x64 machine and encountered a deprecation warning when running 2-Exploratory-Data-Analysis.ipynb in the jupyter notebook.

Issue

Series.nonzero() is deprecated and will be removed in a future version.

Solution

Update code in 2-Exploratory-Data-Analysis.ipynb from original:

uniques = data[comedian].nonzero()[0].size

to

# uniques = data[comedian].nonzero()[0].size (deprecated)
uniques = data[comedian].to_numpy().nonzero()[0].size

Getting this error- Need Help

When i run this code (From one of your python file comparing comedians) while scraping data from urls

Load pickled files

data = {}
for i, c in enumerate(comedians):
with open("transcripts/" + c + ".txt", "rb") as file:
data[c] = pickle.load(file)


FileNotFoundError Traceback (most recent call last)
in
2 data = {}
3 for i, c in enumerate(comedians):
----> 4 with open("transcripts/" + c + ".txt", "rb") as file:
5 data[c] = pickle.load(file)

FileNotFoundError: [Errno 2] No such file or directory: 'transcripts/louis.txt'

AttributeError: 'NoneType' object has no attribute 'find_all'

It should be 'elementor-widget-theme-post-content' instead of 'post-content'

I ran your code with python3 on Colab and I got some errors.

Error:
in transcriptMaker(url)
8 page = requests.get(url).text
9 soup = BeautifulSoup(page, "lxml")
---> 10 text = [p.text for p in soup.find(class_="post-content").find_all('p')]
11 print(url)
12 return text

AttributeError: 'NoneType' object has no attribute 'find_all'

Thanks for your great job

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.