Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bera5186's full-sized avatar
:electron:
Busy Talking to servers

Rahul Bera bera5186

:electron:
Busy Talking to servers
View GitHub Profile
@bera5186
bera5186 / api.js
Created December 15, 2020 12:52
Express api headers for CORS.
const express = require("express")
const app = express();
app.use((req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
res.header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
next();
});
@bera5186
bera5186 / clean_text.py
Created December 20, 2019 08:37
Text data pre-processing and cleaning for ML
from gensim import utils
import gensim.parsing.preprocessing as gsp
filters = [
gsp.strip_tags,
gsp.strip_punctuation,
gsp.strip_multiple_whitespaces,
gsp.strip_numeric,
gsp.remove_stopwords,
gsp.strip_short,
import requests
import sys
from bs4 import BeautifulSoup as bs
base_url = 'https://www.dictionary.com/browse/'
try:
querry = sys.argv[1]
except:
print("Enter The World !")