scrappybara 0.5.0
Natural Language Processing
Requires Python: >=3.6

<a href="https://www.scrappybara.com">
<img
    src="https://raw.githubusercontent.com/ericperriard/scrappybara/master/docs/img/logo.svg"
    width="350"
    style="display: block; width: 350px; margin: auto; margin-bottom: 3em"
/>
</a>

> Python library for Natural Language Processing

## Vision

```text
Computers that understand humans.
````

Scrappybara specializes in Computational Semantics:
*constructing and reasoning with meaning representations of natural language expressions*.

Scrappybara focuses on a single language: English. This commitment allows the development of more advanced linguistic features.

## Documentation

Link | Description
-- | --
[Official website](https://www.scrappybara.com) | Tutorials & API documentation.  
[Quick start](https://www.scrappybara.com/#/quick-start) | Installation guide with an example.

## Where to ask questions

Type | Platform
-- | --
Usage Questions | [Stack Overflow](https://stackoverflow.com/questions/tagged/scrappybara)
Bug reports | [GitHub Issues](https://github.com/ericperriard/scrappybara/issues)
Feature requests | [GitHub Discussions](https://github.com/ericperriard/scrappybara/discussions)

## Linguistic features

- [Entity Linking](#entity-linking):
    - Recognition & disambiguation of 13 million forms
    - Linking to 5.4 million Wikidata URIs
    - Named-entities are categorized by [schemas](https://schema.org/docs/schemas.html) thanks to the knowledge base [Yago4](https://yago-knowledge.org/downloads/yago-4)
    - Every linked-entity has a URL to its Wikipedia article
    
### Entity Linking

Entity Linking is the process of recognizing and disambiguating named-entities according to their context. Words are no longer mere strings or indecipherable word-vectors, they are connected to a Knowledge Base rich of facts.

Therefore, a URI can be converted into categories (e.g. *people*, *event*, *creative work*, etc). It can also be used to extract information about the entity (e.g. *author*, *location*, *dates*, etc).

These URIs bring additional capabilities to NLP applications. They also reduce the amount of data required to train deep-learning models while increasing their accuracy.

#### Example 1 - disambiguation of 2 identical forms

From the following texts:

- *For the Chicago-based artist `Nick Cave`, trash is treasure. In his hands, the discarded detritus of everyday life becomes the foundational element of intricately layered artworks he calls Soundsuits.*

- *The track is an aching piano ballad that finds `Nick Cave` grappling with loss, his lyrics visceral and blunt even as he keeps his piano playing and vocals soft and tender.*

Scrappybara links the first `Nick Cave` to the performance artist:

```json
{
    "start": 29,
    "end": 38,
    "form": "Nick Cave",
    "tag": "PROPN",
    "title": "Nick Cave (performance artist)",
    "uri": "https://www.wikidata.org/wiki/Q24218",
    "wiki": "https://en.wikipedia.org/wiki/Nick_Cave_(performance_artist)",
    "schemas": [
        "http://schema.org/Person"
    ]
}
```

And the second `Nick Cave` to the singer:

```json
{
    "start": 47,
    "end": 56,
    "form": "Nick Cave",
    "tag": "PROPN",
    "title": "Nick Cave",
    "uri": "https://www.wikidata.org/wiki/Q192668",
    "wiki": "https://en.wikipedia.org/wiki/Nick_Cave",
    "schemas": [
        "http://schema.org/Person"
    ]
}
```

#### Example 2 - different forms can link to the same URI

- *The `Austroasiatic languages`, in recent classifications synonymous with `Mon-Khmer`, are a large language family of continental Southeast Asia, also scattered throughout India, Bangladesh, Nepal the southern border of China.*

Scrappybara links `Austroasiatic languages` to *Austro-Asiatic languages*:

```json
{
    "start": 4,
    "end": 27,
    "form": "Austroasiatic languages",
    "tag": "NOUN",
    "title": "Austroasiatic languages",
    "uri": "https://www.wikidata.org/wiki/Q33199",
    "wiki": "https://en.wikipedia.org/wiki/Austroasiatic_languages",
    "schemas": []
}
```

Scrappybara links `Mon-Khmer` to *Austro-Asiatic languages* as well:

```json
{
    "start": 71,
    "end": 80,
    "form": "Mon-Khmer",
    "tag": "PROPN",
    "title": "Austroasiatic languages",
    "uri": "https://www.wikidata.org/wiki/Q33199",
    "wiki": "https://en.wikipedia.org/wiki/Austroasiatic_languages",
    "schemas": []
}
```

#### Try it yourself!

- Follow the tutorial [Link entities mentioned in a text](https://www.scrappybara.com/#/link-entities-mentioned-in-a-text).