mfsadi commited on
Commit
6affc33
1 Parent(s): 9d51185

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -3
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  library_name: transformers
3
- tags: []
4
  ---
5
 
6
  # Model Card for Model ID
@@ -13,24 +13,39 @@ Persian spelling correction model based on LLama3.1 instruct. This model was tra
13
  ### Model Description
14
 
15
  Base_prompt = """You are tasked with correcting spelling mistakes in the queries that users submitted to a Persian marketplace.
 
16
  Output the corrected query in the following JSON format:
 
17
  - If the input requires correction, use:
 
18
  {"correction": "<corrected version of the query>"}
 
19
  - If the input is correct, use:
 
 
20
  "correction": ""}
 
 
21
  Here are some examples:
 
22
  "query": "ندل چسبی زنانه" Your answer: {"correction": "صندل چسبی زنانه"}
 
23
  "query": "بادکنک جشن تواد" Your answer: {"correction": "بادکنک جشن تولد"}
 
24
  "query": "صندلی بادی" Your answer: {"correction": ""}\n"""
25
 
 
 
26
  ## Uses
27
 
28
  It should be used for spelling correction in a setting with Persian language around.
 
29
  ### Direct Use
30
 
 
31
  //output structring
32
  def extract_json(text):
33
- try:
34
  correction = None
35
  pos = 0
36
  decoder = json.JSONDecoder()
@@ -76,10 +91,12 @@ with torch.no_grad():
76
  )
77
  output = tokenizer.decode(output_tokens[0][prompt_length:], skip_special_tokens=True)
78
  return extract_json(output)
79
-
80
 
81
  ## Model Card Contact
82
 
83
  Majid F. Sadi
 
84
 
85
  https://www.linkedin.com/in/mfsadi/
 
1
  ---
2
  library_name: transformers
3
+ tags: [spell_correction]
4
  ---
5
 
6
  # Model Card for Model ID
 
13
  ### Model Description
14
 
15
  Base_prompt = """You are tasked with correcting spelling mistakes in the queries that users submitted to a Persian marketplace.
16
+
17
  Output the corrected query in the following JSON format:
18
+
19
  - If the input requires correction, use:
20
+
21
  {"correction": "<corrected version of the query>"}
22
+
23
  - If the input is correct, use:
24
+
25
+
26
  "correction": ""}
27
+
28
+
29
  Here are some examples:
30
+
31
  "query": "ندل چسبی زنانه" Your answer: {"correction": "صندل چسبی زنانه"}
32
+
33
  "query": "بادکنک جشن تواد" Your answer: {"correction": "بادکنک جشن تولد"}
34
+
35
  "query": "صندلی بادی" Your answer: {"correction": ""}\n"""
36
 
37
+
38
+
39
  ## Uses
40
 
41
  It should be used for spelling correction in a setting with Persian language around.
42
+
43
  ### Direct Use
44
 
45
+ ```python
46
  //output structring
47
  def extract_json(text):
48
+ try:
49
  correction = None
50
  pos = 0
51
  decoder = json.JSONDecoder()
 
91
  )
92
  output = tokenizer.decode(output_tokens[0][prompt_length:], skip_special_tokens=True)
93
  return extract_json(output)
94
+ ```
95
 
96
  ## Model Card Contact
97
 
98
  Majid F. Sadi
99
+
100
101
+
102
  https://www.linkedin.com/in/mfsadi/