paulorvdc commited on
Commit
cbcd579
·
verified ·
1 Parent(s): 780bc49

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -77,7 +77,7 @@ pip install unsloth torch
77
  from unsloth import FastLanguageModel
78
  import torch
79
 
80
- class SPARQLQueryGenerator:
81
  def __init__(self, model_name: str, max_seq_length: int = 32768, load_in_4bit: bool = True):
82
  self.model, self.tokenizer = FastLanguageModel.from_pretrained(
83
  model_name=model_name,
@@ -97,7 +97,7 @@ class SPARQLQueryGenerator:
97
  {"role": "user", "content": article_text}
98
  ]
99
 
100
- def generate_query(self, article_text: str, temperature: float = 0.01, max_new_tokens: int = 1024) -> str:
101
  si = "<|im_start|>assistant<|im_sep|>"
102
  sf = "<|im_end|>"
103
  messages = self.build_prompt(article_text)
@@ -117,9 +117,9 @@ class SPARQLQueryGenerator:
117
 
118
  # --- Using the model ---
119
  if __name__ == "__main__":
120
- generator = SPARQLQueryGenerator(model_name="aksw/Bike-name")
121
  text = "Title, Abstract, Introduction, Background, Method, Results, Conclusion, References."
122
- list_names = generator.generate_query(text)
123
  print(list_names)
124
  ```
125
 
 
77
  from unsloth import FastLanguageModel
78
  import torch
79
 
80
+ class BiKECompoundNameExtractor:
81
  def __init__(self, model_name: str, max_seq_length: int = 32768, load_in_4bit: bool = True):
82
  self.model, self.tokenizer = FastLanguageModel.from_pretrained(
83
  model_name=model_name,
 
97
  {"role": "user", "content": article_text}
98
  ]
99
 
100
+ def extract_compound_name(self, article_text: str, temperature: float = 0.01, max_new_tokens: int = 1024) -> str:
101
  si = "<|im_start|>assistant<|im_sep|>"
102
  sf = "<|im_end|>"
103
  messages = self.build_prompt(article_text)
 
117
 
118
  # --- Using the model ---
119
  if __name__ == "__main__":
120
+ extractor = BiKECompoundNameExtractor(model_name="aksw/Bike-name")
121
  text = "Title, Abstract, Introduction, Background, Method, Results, Conclusion, References."
122
+ list_names = extractor.extract_compound_name(text)
123
  print(list_names)
124
  ```
125