text_plain_output_1.png
from bs4 import BeautifulSoup

import pandas as pd

import requests

ps = soup.find_all('p', {'class': 'sentence-item__text'})

df = pd.DataFrame(columns=['text', 'label'])

days = 'Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.lower().split()
days

days = 'Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.lower().split()
for day in days:
    page = requests.get('https://sentence.yourdictionary.com/saturday')
    soup = BeautifulSoup(page.content, 'html.parser')
    ps = soup.find_all('p', {'class': 'sentence-item__text'})
    for p in ps:
        df = df.append({'text': p.text, 'label': 1}, ignore_index=True)

days = 'Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.lower().split()
for day in days:
    page = requests.get('https://sentence.yourdictionary.com/' + day)
    soup = BeautifulSoup(page.content, 'html.parser')
    ps = soup.find_all('p', {'class': 'sentence-item__text'})
    for p in ps:
        df = df.append({'text': p.text, 'label': 1}, ignore_index=True)

old_dataset.columns = ['text', 'label']

old_dataset.to_csv('good_dataset.csv', index=False)

months = 'January February March April May June July August September October November December'.lower().split()

for month in months:
    page = requests.get('https://sentence.yourdictionary.com/' + month)
    soup = BeautifulSoup(page.content, 'html.parser')
    ps = soup.find_all('p', {'class': 'sentence-item__text'})
    for p in ps:
        df = df.append({'text': p.text, 'label': 1}, ignore_index=True)

for item in ['again']:
    page = requests.get('https://sentence.yourdictionary.com/' + item)
    soup = BeautifulSoup(page.content, 'html.parser')
    ps = soup.find_all('p', {'class': 'sentence-item__text'})
    for p in ps:
        old_dataset = old_dataset.append({'text': p.text, 'label': 0}, ignore_index=True)

old_dataset.shape

old_dataset = pd.read_csv('./events.csv')

old_dataset.shape