desc <- suppressWarnings(readLines("DESCRIPTION")) regex <- "(^Version:\\s+)(\\d+\\.\\d+\\.\\d+)" loc <- grep(regex, desc) ver <- gsub(regex, "\\2", desc[loc]) verbadge <- sprintf('<a href="https://img.shields.io/badge/Version-%s-orange.svg"><img src="https://img.shields.io/badge/Version-%s-orange.svg" alt="Version"/></a></p>', ver, ver) ```` [![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/0.1.0/active.svg)](http://www.repostatus.org/#active) [![Build Status](https://travis-ci.org/trinker/entity.svg?branch=master)](https://travis-ci.org/trinker/entity) [![Coverage Status](https://coveralls.io/repos/trinker/entity/badge.svg?branch=master)](https://coveralls.io/r/trinker/entity?branch=master) `r verbadge` ```r library(knitr) knit_hooks$set(htmlcap = function(before, options, envir) { if(!before) { paste('<p class="caption"><b><em>',options$htmlcap,"</em></b></p>",sep="") } }) knitr::opts_knit$set(self.contained = TRUE, cache = FALSE) knitr::opts_chunk$set(fig.path = "tools/figure/")
entity is wrapper to simplify and extend NLP and openNLP named entity recognition. The package contains 6 entity extractors that take a text vector and return a list of vectors of named entities. The entity extractors include:
person_entity
location_entity
organization_entity
date_entity
money_entity
percent_entity
To download the development version of entity:
Download the zip ball or tar ball, decompress and run R CMD INSTALL
on it, or use the pacman package to install the development version:
if (!require("pacman")) install.packages("pacman") pacman::p_load_gh("trinker/entity")
You are welcome to: submit suggestions and bug-reports at: https://github.com/trinker/entity/issues send a pull request on: https://github.com/trinker/entity/ * compose a friendly e-mail to: tyler.rinker@gmail.com
The following examples demonstrate some of the functionality of termco.
library(entity)
I will demonstrate the 6 annotators on this Wikipedia excerpt about Bell Labs (plus one non Wikipedia line at the end).
data(wiki)
wiki
person_entity(wiki)
location_entity(wiki)
organization_entity(wiki)
date_entity(wiki)
money_entity(wiki)
percent_entity(wiki)
organizations <- organization_entity(presidential_debates_2012$dialogue) plot(organizations)
You can include only entities above a minimum frequency (min = n
) as shown below:
plot(organizations, min = 2)
The user may wish to view the entities alphabetically rather than by frequency. Use alphabetical = TRUE
to accomplish this:
plot(organizations, alphabetical = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.