ilusm.dev

nlp

Natural language processing: tokenization, sentiment, NER, embeddings.

Load with: use nlp

Quick example

use nlp

result = nlptk("value", 10)
prn(result)

Functions

Tokenization

nlptk(s, lang)

Performs the operation. Takes s, lang.

nlpwr(s)

Writes data. Takes s.

nlpsn(s)

Performs the operation. Takes s.

nlpsb(s)

Performs the operation. Takes s.

Normalization

nlpnr(s, opts)

Performs the operation. Takes s, opts.

nlpst(w)

Sets a value or starts a process. Takes w.

nlplm(w)

Returns limits or constraints. Takes w.

Stopwords

nlps1(lang)

Performs the operation. Takes lang.

nlpfl(s, stops)

Performs the operation. Takes s, stops.

N-grams

nlpng(words, n)

Performs the operation. Takes words, n.

nlpch(s, n)

Checks a condition. Takes s, n.

Similarity

nlpcs(a, b)

Performs the operation. Takes a, b.

nlplv(a, b)

Performs the operation. Takes a, b.

nlpjr(a, b)

Performs the operation. Takes a, b.

Sentiment analysis

nlps0(s, model)

Performs the operation. Takes s, model.

Named Entity Recognition

nlpn0(s, model)

Performs the operation. Takes s, model.

Part-of-speech tagging

nlpps(s)

Performs the operation. Takes s.

Dependency parsing

nlpdp(s)

Performs the operation. Takes s.

Chunking

nlpc0(s)

Performs the operation. Takes s.

TF-IDF

nlptf(docs, term)

Performs the operation. Takes docs, term.

Embeddings (word/sentence)

nlpmb(s, model)

Performs the operation. Takes s, model.

nlpsm(e1, e2)

Performs the operation. Takes e1, e2.

Text classification

nlpcl(s, model)

Closes or clears. Takes s, model.

Summarization

nlps2(s, ratio)

Performs the operation. Takes s, ratio.

nlpky(s, n)

Performs the operation. Takes s, n.

Translation

nlptr(s, tgt, src)

Performs the operation. Takes s, tgt, src.

Language detection

nlpln(s)

Performs the operation. Takes s.

Regex patterns

nlprm()

Removes an item.

nlprr()

Performs the operation.

nlprp()

Performs the operation.

nlprh()

Performs the operation.

nlpr0()

Performs the operation.

nlpxt(s, pat)

Performs the operation. Takes s, pat.

WordNet/Lexical

nlpsy(w)

Performs the operation. Takes w.

nlpnt(w)

Performs the operation. Takes w.

nlph0(w)

Performs the operation. Takes w.

nlphy(w)

Performs the operation. Takes w.

Text preprocessing pipeline

nlppp(stages)

Performs the operation. Takes stages.

BLEU score

nlpbl(ref, hyp, n)

Performs the operation. Takes ref, hyp, n.

Rouge score

nlprg(ref, hyp)

Performs the operation. Takes ref, hyp.

Perplexity

nlppr(s, model)

Processes or prints. Takes s, model.

Byte pair encoding

nlpbp(txt, size)

Performs the operation. Takes txt, size.

nlpb1(s, codes)

Performs the operation. Takes s, codes.

nlpb0(ids, codes)

Performs the operation. Takes ids, codes.

Notes

  • Natural language processing - tokenise, stem, TF-IDF, sentiment.