Update README.md
Browse files
README.md
CHANGED
|
@@ -13,29 +13,37 @@ tags:
|
|
| 13 |
# gbpatentdata/lt-patent-inventor-linking
|
| 14 |
|
| 15 |
This is a [LinkTransformer](https://linktransformer.github.io/) model. At its core this model this is a sentence transformer model [sentence-transformers](https://www.SBERT.net) model - it just wraps around the class.
|
| 16 |
-
Take a look at the documentation of [sentence-transformers](https://www.sbert.net/index.html) if you want to use this model for more than what we support in our applications.
|
| 17 |
-
|
| 18 |
This model has been fine-tuned on the model: `sentence-transformers/all-mpnet-base-v2`. It is pretrained for the language: `en`.
|
| 19 |
|
| 20 |
-
## Usage (
|
| 21 |
|
| 22 |
-
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
```
|
| 25 |
-
pip install -U linktransformer
|
| 26 |
-
```
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
|
| 30 |
```python
|
| 31 |
import linktransformer as lt
|
| 32 |
import pandas as pd
|
| 33 |
|
| 34 |
-
df_lm_matched = lt.cluster_rows(df,
|
| 35 |
-
model='
|
| 36 |
-
on=['name', 'occupation', 'year', 'address', 'firm', 'patent_title'],
|
| 37 |
-
cluster_type='SLINK',
|
| 38 |
-
cluster_params={
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
)
|
| 40 |
|
| 41 |
```
|
|
|
|
| 13 |
# gbpatentdata/lt-patent-inventor-linking
|
| 14 |
|
| 15 |
This is a [LinkTransformer](https://linktransformer.github.io/) model. At its core this model this is a sentence transformer model [sentence-transformers](https://www.SBERT.net) model - it just wraps around the class.
|
|
|
|
|
|
|
| 16 |
This model has been fine-tuned on the model: `sentence-transformers/all-mpnet-base-v2`. It is pretrained for the language: `en`.
|
| 17 |
|
| 18 |
+
## Usage (Sentence-Transformers)
|
| 19 |
|
| 20 |
+
To use this model using sentence-transformers:
|
| 21 |
|
| 22 |
+
```python
|
| 23 |
+
from sentence_transformers import SentenceTransformer
|
| 24 |
+
|
| 25 |
+
# load
|
| 26 |
+
model = SentenceTransformer("all-MiniLM-L6-v2")
|
| 27 |
```
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
## Usage (LinkTransformer)
|
| 30 |
+
|
| 31 |
+
To use this model for clustering with [LinkTransformer](https://github.com/dell-research-harvard/linktransformer) installed:
|
| 32 |
|
| 33 |
```python
|
| 34 |
import linktransformer as lt
|
| 35 |
import pandas as pd
|
| 36 |
|
| 37 |
+
df_lm_matched = lt.cluster_rows(df, # df should be a dataset of unique patent-inventors
|
| 38 |
+
model='matthewleechen/lt-patent-inventor-linking',
|
| 39 |
+
on=['name', 'occupation', 'year', 'address', 'firm', 'patent_title'], # cluster on these variables
|
| 40 |
+
cluster_type='SLINK', # use SLINK algorithm
|
| 41 |
+
cluster_params={ # default params
|
| 42 |
+
'threshold': 0.1,
|
| 43 |
+
'min cluster size': 1,
|
| 44 |
+
'metric': 'cosine'
|
| 45 |
+
}
|
| 46 |
+
)
|
| 47 |
)
|
| 48 |
|
| 49 |
```
|