Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- get_chinese_code.py +6 -4
- get_chinese_name.py +2 -2
get_chinese_code.py
CHANGED
@@ -53,9 +53,11 @@ def get_chinese_name(path):
|
|
53 |
chinese_name.append(df['word'][df['code'] == str(w2)].iloc[0])
|
54 |
if w3 is not None:
|
55 |
chinese_name.append(df['word'][df['code'] == str(w3)].iloc[0])
|
56 |
-
|
|
|
|
|
|
|
57 |
chinese_name = []
|
|
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
print(get_chinese_name('dontTouchMe/IMG_4495.jpg'))
|
|
|
53 |
chinese_name.append(df['word'][df['code'] == str(w2)].iloc[0])
|
54 |
if w3 is not None:
|
55 |
chinese_name.append(df['word'][df['code'] == str(w3)].iloc[0])
|
56 |
+
chinese_complete = ""
|
57 |
+
for item in chinese_name:
|
58 |
+
chinese_complete = chinese_complete + item
|
59 |
+
return chinese_complete
|
60 |
chinese_name = []
|
61 |
+
return ""
|
62 |
|
63 |
+
# print(get_chinese_name('image\hkid.jpg'))
|
|
|
|
get_chinese_name.py
CHANGED
@@ -23,9 +23,9 @@ def get_chiname(path):
|
|
23 |
model = "gpt-3.5-turbo",
|
24 |
temperature = 0,
|
25 |
messages = [
|
26 |
-
{"role": "system", "content": "You are an AI assistant for extracting Chinese name from
|
27 |
{"role": "user", "content": f"Extract data from the following set of text: {data_set_1}. \
|
28 |
-
You only need to return a dictonary with Chinese name in Chinese. Use double quote
|
29 |
]
|
30 |
)
|
31 |
|
|
|
23 |
model = "gpt-3.5-turbo",
|
24 |
temperature = 0,
|
25 |
messages = [
|
26 |
+
{"role": "system", "content": "You are an AI assistant for extracting Chinese name (usually in length of three) from Hong Kong ID card."},
|
27 |
{"role": "user", "content": f"Extract data from the following set of text: {data_set_1}. \
|
28 |
+
You only need to return a dictonary with Chinese name in Chinese. Use double quote."},
|
29 |
]
|
30 |
)
|
31 |
|