@angularai/doc-intelligence
v0.0.3
Published
<div align="center"> <h1>@angularai/doc-intelligence</h1> <p>π AI-powered document processing and OCR for Angular applications</p>
Downloads
371
Readme
Overview
@angularai/doc-intelligence provides AI-powered document processing, OCR, and text extraction capabilities for Angular applications. Extract text, analyze documents, and process PDFs with intelligent AI assistance.
β¨ Features
- π Document Processing: Extract text from PDFs, images, and documents
- π OCR Support: Optical character recognition for scanned documents
- π§ AI Analysis: Intelligent document understanding and summarization
- π Data Extraction: Extract structured data from unstructured documents
- π§ Fully Typed: Complete TypeScript support
- π± File Upload: Drag-and-drop file upload component
π¦ Installation
npm install @angularai/doc-intelligence @angularai/coreπ Quick Start
1. Import the Component
import { Component } from '@angular/core';
import { DocProcessorComponent } from '@angularai/doc-intelligence';
@Component({
selector: 'app-doc-processor',
standalone: true,
imports: [DocProcessorComponent],
template: `
<doc-processor
[provider]="'openai'"
[apiKey]="apiKey"
(textExtracted)="onTextExtracted($event)"
(documentAnalyzed)="onAnalyzed($event)"
/>
`
})
export class DocProcessorComponent {
apiKey = 'your-openai-api-key';
onTextExtracted(text: string) {
console.log('Extracted text:', text);
}
onAnalyzed(analysis: DocumentAnalysis) {
console.log('Document analysis:', analysis);
}
}2. Use the Document Service
import { Component, inject } from '@angular/core';
import { DocIntelligenceService } from '@angularai/doc-intelligence';
@Component({ ... })
export class DocumentComponent {
private docService = inject(DocIntelligenceService);
async processDocument(file: File) {
this.docService.extractText(file).subscribe({
next: (text) => console.log('Extracted:', text),
error: (err) => console.error('Error:', err)
});
}
async summarizeDocument(file: File) {
this.docService.summarize(file).subscribe({
next: (summary) => console.log('Summary:', summary)
});
}
}π API Reference
DocIntelligenceService
@Injectable({ providedIn: 'root' })
export class DocIntelligenceService {
// Extract text from document
extractText(file: File): Observable<string>;
// Summarize document content
summarize(file: File): Observable<string>;
// Extract structured data
extractData(file: File, schema: DataSchema): Observable<any>;
// Analyze document
analyze(file: File): Observable<DocumentAnalysis>;
}Supported File Types
| Type | Extensions | Status | |------|------------|--------| | PDF | .pdf | β Available | | Images | .jpg, .png, .gif | β Available | | Documents | .doc, .docx | β Available | | Text | .txt, .md | β Available |
π¦ Related Packages
| Package | Description | |---------|-------------| | @angularai/core | Core AI functionality | | @angularai/image-caption | AI image captioning |
π Related Projects
| Framework | Repository | Status | |-----------|-----------|--------| | Vue.js | @aivue | β Available | | React | @anthropic-ai/react | β Available | | Angular | @angularai | β Available | | Svelte | @svelteai | π‘ Planned |
π License
MIT Β© AngularAI
