Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Shubhanshu Mishra napsternxg

🎯
Focusing
View GitHub Profile
View WRP_national.csv
We can't make this file beautiful and searchable because it's too large.
year,state,name,chrstprot,chrstcat,chrstorth,chrstang,chrstothr,chrstgen,judorth,jdcons,judref,judothr,judgen,islmsun,islmshi,islmibd,islmnat,islmalw,islmahm,islmothr,islmgen,budmah,budthr,budothr,budgen,zorogen,hindgen,sikhgen,shntgen,bahgen,taogen,jaingen,confgen,syncgen,anmgen,nonrelig,othrgen,sumrelig,pop,chrstprotpct,chrstcatpct,chrstorthpct,chrstangpct,chrstothrpct,chrstgenpct,judorthpct,judconspct,judrefpct,judothrpct,judgenpct,islmsunpct,islmshipct,islmibdpct,islmnatpct,islmalwpct,islmahmpct,islmothrpct,islmgenpct,budmahpct,budthrpct,budothrpct,budgenpct,zorogenpct,hindgenpct,sikhgenpct,shntgenpct,bahgenpct,taogenpct,jaingenpct,confgenpct,syncgenpct,anmgenpct,nonreligpct,othrgenpct,sumreligpct,total,dualrelig,datatype,sourcereliab,recreliab,reliabilevel,Version,sourcecode
1945,2,USA,66069671,38716742,1121898,2400000,1956807,110265118,821489,1364508,1902885,552300,4641182,0,0,0,0,0,0,0,0,0,0,1601218,1601218,0,0,0,0,0,0,0,0,0,0,22874544,545938,139382062,139928000,0.4722,0.2767,0.0080,0.0172,0.0140,0.788
View fakenews_urls.json
[
"2nd Amendment Daily News (secondamendmentdaily.com)",
"3CCorp.net",
"100% Fed up (100percentfedup.com)",
"10News.one (www.10news.one)",
"12minutos.com",
"A Voice for Men (www.avoiceformen.com)",
"Action News 3",
"Activist Mommy (activistmommy.com)",
"AjuaNews.com",
View aqi_5cd80264_daily_air-quality.com.json
{
"success": true,
"data": {
"sources": ["http:\/\/www.cpcb.nic.in"],
"history": [{
"type": "index",
"kind": "aqi_us",
"interval": "daily",
"unit": "",
"name": "",
View india_boxofficemoji_2019_2020.json
[
{"Dates": "Mar 13-15", "Top 10 Gross": "$342,321", "%± LW": "+44.7%", "Overall Gross": "$342,321", "Releases": "5", "#1 Release": "Bloodshot", "Week": "11"},
{"Dates": "Mar 6-8", "Top 10 Gross": "$236,552", "%± LW": "-87.7%", "Overall Gross": "$236,552", "Releases": "5", "#1 Release": "Onward", "Week": "10"},
{"Dates": "Feb 28-Mar 1", "Top 10 Gross": "$1,925,715", "%± LW": "-80.7%", "Overall Gross": "$1,925,715", "Releases": "7", "#1 Release": "Thappad", "Week": "9"},
{"Dates": "Feb 21-23", "Top 10 Gross": "$9,963,461", "%± LW": "+168.1%", "Overall Gross": "$9,963,461", "Releases": "10", "#1 Release": "Shubh Mangal Zyada Saavdhan", "Week": "8"},
{"Dates": "Feb 14-16", "Top 10 Gross": "$3,715,728", "%± LW": "-26.5%", "Overall Gross": "$3,716,243", "Releases": "11", "#1 Release": "Love Aaj Kal", "Week": "7"},
{"Dates": "Feb 7-9", "Top 10 Gross": "$5,051,826", "%± LW": "+340.3%", "Overall Gross": "$5,054,105", "Releases": "12", "#1 Release": "Malang", "Week": "6"},
{"Dates": "Jan 31
@napsternxg
napsternxg / conll18_ud_eval.md
Last active Mar 25, 2020
Modified conll18_ud_eval to output JSON
View conll18_ud_eval.md
View TRAC2020_archive.sh
%%bash
TASK="Sub-task A"
LANG="ENG"
MODEL="bert-base-cased"
tar -czvf "./${LANG}/${TASK}/output/${MODEL}.tar.gz" "./${LANG}/${TASK}/output/${MODEL}"/{*.tsv,*.json,events.*,model/config.json}
# Upload to bashupload
curl "https://bashupload.com/${LANG}_${TASK}_${MODEL}.tar.gz" --data-binary @"./${LANG}/${TASK}/output/${MODEL}.tar.gz"
View index.html
<!DOCTYPE HTML>
<html>
<head>
<title>langid.js demonstration</title>
<script src="https://raw.githubusercontent.com/saffsd/langid.js/master/langid-model-full.js"></script>
<script src="langid.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$("#typerArea").keyup(displayType);
@napsternxg
napsternxg / NER eval.ipynb
Last active Nov 3, 2020
Evaluate NER predictions
View NER eval.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View shutdowns.json
[
{
"state:name": "Jammu and Kashmir",
"districts": [
"Kashmir"
],
"date": "2012-01-26",
"description": "Mobile Internet as a part of a larger mobile telephony ban was restricted on 26th January, 2012 as a standard security protocol.",
"source": "http://www.hindustantimes.com/india/mobile-phone-blackout-in-kashmir/story-UR9ES3PoX4jnASE5FuCZQN.html"
},
@napsternxg
napsternxg / extract_entities.md
Last active Nov 7, 2019
Extract Entities from NER labels
View extract_entities.md
def split_tag(tag):
    return tuple(tag.split("-", 1)) if tag != "O" else (tag, None) 
    
def extract_entities(tags):
    curr_entity = []
    entities = []
    for i,tag in enumerate(tags + ["O"]):
        # Add dummy tag in end to ensure the last entity is added to entities