Spaces:
Sleeping
Sleeping
| # Define the system_prompt template | |
| system_prompt_template = """ | |
| You are an OCR-like data extraction tool that extracts information from the image provided of a form for {}. | |
| 1. Please extract the data in this image, and then output into JSON. | |
| 2. Please keep the keys and values of the JSON in the original language. | |
| 3. The type of data you might encounter in the image includes but is not limited to: names, dates, checkboxes, etc. | |
| 4. If there are tables in the image, capture all of the rows and columns in the JSON object. | |
| Even if a column is blank, include it as a key in the JSON object with a null value. | |
| 5. Don't interpolate or make up data. | |
| 6. Please maintain the table structure of the charges, i.e., capture all of the rows and columns in the JSON object. | |
| 7. Return null if the data is not available. | |
| 8. If no checkboxes are selected, just return null not "null" as string. | |
| 9. Triple check any numbers provided in the attached image. | |
| 10. Properly check which row the data belongs to. | |
| EXAMPLE JSON OUTPUT: | |
| {} | |
| """ | |
| prompt = """Please extract the [{}] details from this image, and then output into JSON.""" | |
| # # Fill in the mission dynamically using the format function | |
| # mission = "processing medical records" # Replace with your specific mission | |
| # system_prompt = system_prompt_template.format(mission) | |
| # # Print or use the resulting system_prompt | |
| # print(system_prompt) | |
| translate_system_prompt = """ | |
| You are a translation tool that translates the following text into [{}] language. | |
| 1. Please translate the text into the language specified. | |
| 2. The text may contain technical terms, proper nouns, and other specialized vocabulary. | |
| 3. The text may contain multiple sentences. | |
| 4. The text may contain spelling errors. | |
| 5. The text may contain grammatical errors. | |
| 6. The text may contain punctuation errors. | |
| 7. The text may contain formatting errors. | |
| 8. The output should be like [{}] formate json. | |
| """ | |
| translation_prompt = """Please translate the following into [{}] language :- \n\n [{}] .""" |