Update README.md
Browse files
README.md
CHANGED
@@ -18,10 +18,10 @@ This model is a VGCN-BERT model based on [DistilBert-base-uncased](https://huggi
|
|
18 |
|
19 |
```python
|
20 |
import transformers as tfr
|
21 |
-
from transformers.models.vgcn_bert.modeling_graph import WordGraph
|
22 |
|
23 |
tokenizer = tfr.AutoTokenizer.from_pretrained(
|
24 |
-
"zhibinlu/
|
25 |
)
|
26 |
# 1st method: Build graph using NPMI statistical method from training corpus
|
27 |
wgraph = WordGraph(rows=train_valid_df["text"], tokenizer=tokenizer)
|
@@ -42,7 +42,7 @@ from transformers.models.vgcn_bert.modeling_vgcn_bert import VGCNBertModel
|
|
42 |
model = VGCNBertModel.from_pretrained(
|
43 |
"zhibinlu/vgcn-bert-distilbert-base-uncased", trust_remote_code=True,
|
44 |
wgraphs=[wgraph.to_torch_sparse()],
|
45 |
-
wgraph_id_to_tokenizer_id_maps=[wgraph.wgraph_id_to_tokenizer_id_map]
|
46 |
)
|
47 |
text = "Replace me by any text you'd like."
|
48 |
encoded_input = tokenizer(text, return_tensors="pt")
|
|
|
18 |
|
19 |
```python
|
20 |
import transformers as tfr
|
21 |
+
from transformers.models.vgcn_bert.modeling_graph import WordGraph
|
22 |
|
23 |
tokenizer = tfr.AutoTokenizer.from_pretrained(
|
24 |
+
"zhibinlu/distilbert-base-uncased"
|
25 |
)
|
26 |
# 1st method: Build graph using NPMI statistical method from training corpus
|
27 |
wgraph = WordGraph(rows=train_valid_df["text"], tokenizer=tokenizer)
|
|
|
42 |
model = VGCNBertModel.from_pretrained(
|
43 |
"zhibinlu/vgcn-bert-distilbert-base-uncased", trust_remote_code=True,
|
44 |
wgraphs=[wgraph.to_torch_sparse()],
|
45 |
+
wgraph_id_to_tokenizer_id_maps=[wgraph.wgraph_id_to_tokenizer_id_map]
|
46 |
)
|
47 |
text = "Replace me by any text you'd like."
|
48 |
encoded_input = tokenizer(text, return_tensors="pt")
|