AightBits

Unstructured to Structured NER Prompt

Mar 7th, 2025
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. Initial prompt:
  2. ===============
  3.  
  4. Objective:
  5.  
  6. Extract structured contact information from the provided unformatted text and convert it into CSV format with specified columns. Capture all available information, even if some fields are missing. Format all phone numbers as (XXX) XXX-XXXX and ensure city and state are captured separately from the address.
  7.  
  8. Columns to Extract:
  9.  
  10. - Name: Full name of the person (e.g., "John Doe")
  11. - Email: Email address of the person (e.g., "[email protected]")
  12. - Phone: Phone number formatted as "(XXX) XXX-XXXX" (e.g., "(555) 123-4567")
  13. - Address: Street address without city, state, or ZIP (e.g., "432 Oak St")
  14. - City: Full city name (e.g., "Springfield")
  15. - State: Two-letter state abbreviation (e.g., "IL")
  16. - Zip: Postal ZIP code (e.g., "60901")
  17.  
  18. Instructions:
  19.  
  20. 1. Read the Unformatted Text Carefully: Identify and extract each piece of information based on common patterns and keywords.
  21.  
  22. 2. Use Patterns for Extraction:
  23. - Phone Numbers: Look for patterns like "(XXX) XXX-XXXX" or "XXX-XXX-XXXX" and reformat to "(XXX) XXX-XXXX".
  24. - Email Addresses: Identify email patterns using "[email protected]".
  25. - Addresses: Extract street addresses and separate them from city, state, and ZIP code information.
  26.  
  27. 3. Identify Keywords and Phrases:
  28. - Use common indicators like Email:, Phone:, Address:, City:, State:, and ZIP: to locate relevant data.
  29.  
  30. 4. Format Data into CSV:
  31. - Enclose each field in double quotes.
  32. - Separate fields with commas.
  33. - Ensure no extra spaces around commas.
  34.  
  35. 5. Handle Missing Data:
  36. - Leave fields blank if no information is available.
  37. - Include city and state if known, even if other fields are blank.
  38.  
  39. Error Handling:
  40.  
  41. - Flag Entries for Review: Identify entries with incomplete data for manual review.
  42. - Correct Misplaced or Incorrect Data: Adjust any misplaced data or incorrect formatting according to the specified rules.
  43.  
  44. Example:
  45.  
  46. Given the unformatted text:
  47.  
  48. John Doe - [email protected]
  49. (555) 123-4567
  50. 432 Oak St, Springfield, IL
  51.  
  52. The extracted CSV should be:
  53.  
  54. "Name","Email","Phone","Address","City","State","Zip"
  55. "John Doe","[email protected]","(555) 123-4567","432 Oak St","Springfield","IL",""
  56.  
  57. Data to process:
  58.  
  59. [unstructured data]
  60.  
  61.  
  62.  
  63. Followup prompt:
  64. ================
  65.  
  66. Review each line carefully referring back to the original data correcting all errors and omissions.
Advertisement
Add Comment
Please, Sign In to add comment