@@ -68,68 +68,7 @@ pip install datafog
68
68
69
69
## Examples - Updated for v3
70
70
71
-
72
-
73
- ```
74
- # Example: Annotating PII
75
- from datafog import PIIAnnotationPipeline, PIIAnnotationRequest
76
-
77
- # Initialize the PII annotation pipeline
78
- pii_pipeline = PIIAnnotationPipeline()
79
-
80
- # Provide the text or document containing PII
81
- pii_text = "Name: John Doe\nAddress: 123 Main St, Anytown, USA"
82
-
83
- # Submit the text for PII annotation
84
- annotated_text = pii_pipeline.annotate_pii(pii_text)
85
-
86
- # Print the annotated text with identified PII
87
- print("Annotated Text:")
88
- print(annotated_text)
89
-
90
-
91
- # Example: Text Extraction from images
92
-
93
- from datafog import DonutImageProcessor, PipelineOperationType
94
-
95
- # Initialize the image processor
96
- processor = DonutImageProcessor(operation_type=PipelineOperationType.PARSE_IMAGE)
97
-
98
- # Load the image containing the invoice
99
- sample_image_path = "path/to/your/invoice/image.png"
100
-
101
- # Parse the invoice image to extract details
102
- result = processor.parse_invoice(sample_image_path)
103
-
104
- # Print the extracted details
105
- print("Invoice Details:")
106
- for item in result:
107
- print(f"- {item['name']}: {item['price']}")
108
-
109
-
110
-
111
- # Example: Text Extraction
112
- from datafog import DataFog, PipelineOperationType
113
-
114
- # Initialize DataFog for text processing
115
- data_processor = DataFog(operation_type=PipelineOperationType.PROCESS_TEXT)
116
-
117
- # Provide the text to be analyzed
118
- text = "Customer: John Smith\nProduct: Laptop\nPrice: $1200"
119
-
120
- # Extract entities from the text
121
- entities = data_processor.extract_entities(text)
122
-
123
- # Print the extracted entities
124
- print("Entities Detected:")
125
- for entity in entities:
126
- print(f"- {entity['type']}: {entity['text']}")
127
-
128
-
129
-
130
-
131
- ```
132
-
71
+ Check out for examples to get started with datafog v3: https://colab.research.google.com/drive/1k3HPaOTur3iDfBdWXh7O_EjzsjI_K6wT#scrollTo=WNtUZ497_0kd
133
72
134
73
135
74
## Contributing
0 commit comments