kuelumbus commited on
Commit
7d672d7
·
1 Parent(s): 0b30ef9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -14
README.md CHANGED
@@ -9,7 +9,7 @@ tags:
9
 
10
  # kuelumbus/polyBERT
11
 
12
- This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 600 dimensional dense vector space and can be used for tasks like clustering or semantic search.
13
 
14
  <!--- Describe your model here -->
15
 
@@ -25,10 +25,10 @@ Then you can use the model like this:
25
 
26
  ```python
27
  from sentence_transformers import SentenceTransformer
28
- sentences = ["This is an example sentence", "Each sentence is converted"]
29
 
30
  model = SentenceTransformer('kuelumbus/polyBERT')
31
- embeddings = model.encode(sentences)
32
  print(embeddings)
33
  ```
34
 
@@ -50,35 +50,31 @@ def mean_pooling(model_output, attention_mask):
50
 
51
 
52
  # Sentences we want sentence embeddings for
53
- sentences = ['This is an example sentence', 'Each sentence is converted']
54
 
55
  # Load model from HuggingFace Hub
56
  tokenizer = AutoTokenizer.from_pretrained('kuelumbus/polyBERT')
57
  model = AutoModel.from_pretrained('kuelumbus/polyBERT')
58
 
59
  # Tokenize sentences
60
- encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
61
 
62
  # Compute token embeddings
63
  with torch.no_grad():
64
  model_output = model(**encoded_input)
65
 
66
  # Perform pooling. In this case, mean pooling.
67
- sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
68
 
69
- print("Sentence embeddings:")
70
- print(sentence_embeddings)
71
  ```
72
 
73
 
74
 
75
  ## Evaluation Results
76
 
77
- <!--- Describe how your model was evaluated -->
78
-
79
- For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name=kuelumbus/polyBERT)
80
-
81
-
82
 
83
  ## Full Model Architecture
84
  ```
@@ -90,4 +86,4 @@ SentenceTransformer(
90
 
91
  ## Citing & Authors
92
 
93
- <!--- Describe where people can find more information -->
 
9
 
10
  # kuelumbus/polyBERT
11
 
12
+ This is polyBERT: A chemical language model to enable fully machine-driven ultrafast polymer informatics. polyBERT maps PSMILES strings to 600 dimensional dense fingerprints. The fingerprints numerically represent polymer chemical structures.
13
 
14
  <!--- Describe your model here -->
15
 
 
25
 
26
  ```python
27
  from sentence_transformers import SentenceTransformer
28
+ psmiles_strings = ["[*]CC[*]", "[*]COC[*]"]
29
 
30
  model = SentenceTransformer('kuelumbus/polyBERT')
31
+ embeddings = model.encode(psmiles_strings)
32
  print(embeddings)
33
  ```
34
 
 
50
 
51
 
52
  # Sentences we want sentence embeddings for
53
+ psmiles_strings = ["[*]CC[*]", "[*]COC[*]"]
54
 
55
  # Load model from HuggingFace Hub
56
  tokenizer = AutoTokenizer.from_pretrained('kuelumbus/polyBERT')
57
  model = AutoModel.from_pretrained('kuelumbus/polyBERT')
58
 
59
  # Tokenize sentences
60
+ encoded_input = tokenizer(psmiles_strings, padding=True, truncation=True, return_tensors='pt')
61
 
62
  # Compute token embeddings
63
  with torch.no_grad():
64
  model_output = model(**encoded_input)
65
 
66
  # Perform pooling. In this case, mean pooling.
67
+ fingerprints = mean_pooling(model_output, encoded_input['attention_mask'])
68
 
69
+ print("Fingerprints:")
70
+ print(fingerprints)
71
  ```
72
 
73
 
74
 
75
  ## Evaluation Results
76
 
77
+ See https://github.com/Ramprasad-Group/polyBERT
 
 
 
 
78
 
79
  ## Full Model Architecture
80
  ```
 
86
 
87
  ## Citing & Authors
88
 
89
+ t.b.d.