Skip to content

Instantly share code, notes, and snippets.

View eaglewarrior's full-sized avatar
👩‍💻
Building Scalable Efficient AI

RINKI NAG eaglewarrior

👩‍💻
Building Scalable Efficient AI
View GitHub Profile
@eaglewarrior
eaglewarrior / clean_text.py
Last active March 5, 2021 15:32
Cleaning the text and make it word cloud ready
import re
import unicodedata
from nltk.corpus import stopwords
import nltk
def removetitle(text):
return re.sub(r'.*:', '', text)
def removebrackets(text):
return re.sub('[\(\[].*?[\)\]]', ' ', text)
@eaglewarrior
eaglewarrior / AI_news_article_scraping.py
Created March 5, 2021 15:21
All together the code for scraping articles
### Importing all packages
import requests
import urllib.request
import time
import spacy
from bs4 import BeautifulSoup
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
import matplotlib.pyplot as plt
### Making query for searching article