You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/few-shot-examples.md
+262-4Lines changed: 262 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -849,16 +849,274 @@ extraction:
849
849
{DOCUMENT_TEXT}
850
850
```
851
851
852
+
## Dynamic Few-Shot Prompting
853
+
854
+
Dynamic few-shot prompting takes the few-shot examples feature to the next level by automatically selecting the most relevant examples based on document similarity using vector search. Instead of using static examples defined in your configuration, the system dynamically retrieves similar documents from a vector database at processing time.
855
+
856
+
### Overview
857
+
858
+
Dynamic few-shot prompting uses Amazon S3 Vectors and Amazon Nova multimodal embeddings to:
859
+
- **Automatically find similar examples** based on visual and content similarity
860
+
- **Retrieve relevant examples** from a large dataset without manual configuration
861
+
- **Adapt to document variations** by selecting the most appropriate examples for each document
862
+
- **Scale to large example datasets** without impacting configuration complexity
- Document processing with dynamic few-shot enabled
1105
+
- Comparison with static few-shot and no examples
1106
+
- Accuracy and cost analysis
1107
+
- Example retrieval visualization
1108
+
852
1109
## Future Capabilities
853
1110
854
1111
The few-shot examples feature continues to evolve with planned enhancements:
855
1112
856
-
- **Dynamic Example Selection**: Automatically choose the most relevant examples based on document similarity
1113
+
- **Hybrid Example Selection**: Combine static and dynamic examples for optimal results
857
1114
- **Quality Assessment**: Automated evaluation of example quality and recommendations for improvement
858
1115
- **Confidence Integration**: Use few-shot examples to improve confidence scoring
859
1116
- **Additional Formats**: Support for more example formats and metadata
860
1117
- **Enhanced Caching**: More sophisticated caching strategies for different use cases
861
-
- **Hybrid Examples**: Better integration of text and image content within examples
862
-
- **Enhanced Multi-Image Support**: Advanced algorithms for optimal image selection from directories
1118
+
- **Multi-Modal Fusion**: Better integration of text and image content within examples
1119
+
- **Adaptive Thresholds**: Automatically adjust similarity thresholds based on document characteristics
1120
+
- **Example Ranking**: Advanced algorithms for optimal example selection and ordering
863
1121
864
-
Few-shot examples with prompt caching represent a significant step forward in making Pattern-2 more accurate, cost-effective, and easier to configure for diverse document processing scenarios. The flexibility to use images, text, or both, combined with support for multiple images per example, provides comprehensive options for different security, privacy, and performance requirements.
1122
+
Few-shot examples with prompt caching and dynamic selection represent a significant step forward in making Pattern-2 more accurate, cost-effective, and easier to configure for diverse document processing scenarios. The flexibility to use static or dynamic examples, images or text, combined with support for multiple images per example, provides comprehensive options for different security, privacy, and performance requirements.
0 commit comments