npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nlp-corpus

v4.4.0

Published

texts for integration testing of nlp components

Downloads

337

Readme

nlp-corpus is a proud series of weird texts from a delicious smattering of sources - aimed at getting cosmopolitan flavours of english - highbrow, lowbrow and unibrow - dialects, typos, shakespeare, unicode, 19th century, aggressive emoji, and epic nsfw slurs into your training data.

it is 50,000 sentences, or 5mb, split into 50 files of randomized sentences.

it's role is mainly to kick the tires a bit, as creatively as possible, for fuzzy linguistic parsing.

  • suggestive American rock lyrics
  • campy Friends tv-show transcripts
  • vulnerable drug-trip reports from Erowid
  • singaporean SMS messages
  • State of the union logorrhea
  • generally-offensive 90's rap
  • Legal descriptions in NAFTA
  • 20th century romantic fiction
  • pedantic arguments on reddit
  • arcane and dense jeopardy questions

Note that some of this text is nsfw, or containing offensive content, badly-formatted unicode, weird indentation, ascii art, antiquated shorthands, etc.

These texts were found just clicking around on the internet. Running them blindly through your parser should be considered fair-use, but please don't commercially republish them, or anything like that.

ok go.

npm install nlp-corpus

running this library server-side loads a subset of the documents - abt 3mb total

import corpus from 'nlp-corpus'

// all 10k sentences, in an array
let arr = corpus.all()

// or load just a few:
arr = corpus.some(400)

//random sentence
let str = corpus.random()
//random 5 sentences
let arr = corpus.some(5) //n can only be <= 1,500

or on the client-side, there's a one-liner that fetches the docs:

<script src="http://unpkg.com/nlp-corpus"></script>
<script>
  // load a documents lazily
  await nlpCorpus.fetch(2) //1 - 20
  // (each doc is abt 150kb)
  let arr = nlpCorpus.random(4) //1 - 1,500
</script>

Contents:

the corpus is availble as [./builds](100 150kb files) where each file is 1,000 mixed sentences.

This is a good size for picking-at from the client-side - but you can loop through them all in nodejs.

in total, there are 100,000 sentences, at around 12mb.

Dialog

Music lyrics

short, modern texts with some nice slang.

Fiction

some CC-BY fiction pieces by some selected authors. Mix of tense, dialogue, subject, and style. ~300kb

Erowid trip reports - some very casual and modern slang-filled drug-use reports from erowid.org ~nsfw.

Children's stories from the facebook children's stories corpus

Speeches

State of the union transcripts - American presidential speech transcripts from 2000-2015. ~600kb

Wikipedia

a bunch of articles from wikipedia's Articles every Wikipedia must have list

Internet comments

Reddit /r/TLDR corpus from this dataset

Questions

sample of jeopardy questions from this dataset

Instructions

sample of wikihow instructions from this dataset

News Headlines

sample of the times of india headlines from this dataset

Reviews

subset of reviews from the Yelp academic dataset

subset of imdb reviews from the Stanford Large Movie Review Dataset

Legal Text

subset of the SigmaLaw - Large Legal Text Corpus

subset of the United Nations Multilingual corpus (english subset)

Jokes & puns

Super-corny dad-jokes (some offensive) from CrowdTruth/Short-Text-Corpus-For-Humor-Detection

Literature

subsets of Infinite Jest and Edgar Allen Poe short stories

Email text

subsets of the ENRON email dataset