1 Commits
Author SHA1 Message Date
089ba8f34e Copilot Chat: Feature/tesseract ocr Issue #1440 (#1491)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to? 
4. If it fixes an open issue, please link to the issue here.
(https://github.com/microsoft/semantic-kernel/issues/1440)
-->
Extends the `copilot-chat-app`
(https://github.com/microsoft/semantic-kernel/tree/9ba5c6b044e9697393e34129acf383c19b786d60/samples/apps/copilot-chat-app)
sample to allow for importing images with text using the Tesseract
library (https://github.com/charlesw/tesseract/)

Issue:  [Support Tesseract / OCR in Copilot Example #1440] 

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

Added a new "Tesseract" section within `appsettings.json` to specify
Tesseract language file (eg: eng)
Added corresponding `TesseractOptions` class and set up appropriate DI
for use within the `DocumentImportController`.
Added appropriate file extension mappings for common rasterized image
formats: `png`, `jpg`, `tiff`.
Updated frontend Web App to default to allowing these file extensions
when selecting the File Import (paper clip icon) button.
Added content to README.md within the `webapi` to explain usage.

### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [ ] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Gina Triolo <[email protected]>
Co-authored-by: Tao Chen <[email protected]>
2023-07-12 23:52:40 +00:00