Skip to content

Commit

Permalink
Installation
Browse files Browse the repository at this point in the history
  • Loading branch information
kvh committed Mar 26, 2017
1 parent 6852085 commit 9d345a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ Probabilistic Entity Matching
* Documentation: https://match.readthedocs.io.


Installation
--------

* TODO

Usage
--------

Basic entity detection and matching for built-in types.

```python
>>> import match
>>> match.detect_type('608-555-5555')
(1, PhoneNumberType)
Expand Down Expand Up @@ -58,11 +64,13 @@ Basic entity detection and matching for built-in types.
(datetime.datetime(1997, 3, 3), DateTimeType)
>>> match.parse_as_type(' march 3rd, 1997', 'email')
None
```

Probabilistic matching, based on frequencies in a given corpus.

```python
>>> from match import similarities
>>> import random
>>> corpus = random.sample('a'*10000 + ' '*10000 + 'b'*1000 + 'c'*100 + 'd'*10, k=21110)
Expand All @@ -71,17 +79,20 @@ Probabilistic matching, based on frequencies in a given corpus.
.6
>>> psim.similarity('db bd c', 'db bd a') # Higher similarity since 'd' is rare
.8
```

Custom types

```python
>>> from match.similarity import ProbabilisticDiceCoefficient
>>> corpus = ''.join(['cheddar', 'brie', 'guyere', 'mozzarella', 'parmesian', 'jack', 'colby'])
>>> cheese_sim = ProbabilisticDiceCoefficient(corpus)
>>> match.add_type('cheese', StringType(similarity_measure=cheese_sim))
>>> match.detect_type('colby jack')
(.8, 'cheese')
```

Credits
Expand Down

0 comments on commit 9d345a2

Please sign in to comment.