Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pptx): support image description with LLM for pptx files #306

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

masquare
Copy link

@masquare masquare commented Jan 27, 2025

This PR adds support for creating image descriptions with LLMs for images in pptx files.

The functionality is optional, and will be enabled with an llm_model and llm_client parameter configured. If those are not provided, markitdown will default to using the image alt_text for the description

Example

Input slide (with image on right-hand side)

Screenshot 2025-01-27 at 14 17 46

Output

# 2cdda5c8-e50e-4db4-b5f0-9722a649f455
AutoGen is an open-source framework that allows developers to build LLM applications via multiple agents that can converse with each other to accomplish tasks. AutoGen agents are customizable, conversable, and can operate in various modes that employ combinations of LLMs, human inputs, and tools. Using AutoGen, developers can also flexibly define agent interaction behaviors. Both natural language and 04191ea8-5c73-4215-a1d3-1cfb43aaaf12 can be used to program flexible conversation patterns for different applications. AutoGen serves as a generic framework for building diverse applications of various complexities and LLM capacities. Empirical studies demonstrate the effectiveness of the framework in many example applications, with domains ranging from mathematics, coding, question answering, operations research, online decision-making, entertainment, etc.

![The image features a research paper titled "AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation." It includes diagrams illustrating agent customization, multi-agent conversations, and example agent chats, highlighting the framework's capabilities in developing LLM applications through flexible interaction patterns.](Picture4.jpg)

Code example

from markitdown import MarkItDown
from openai import OpenAI

client = OpenAI()

md = MarkItDown(llm_client=client, llm_model="gpt-4o-mini")
result = md.convert("tests/test_files/test.pptx")
print(result.text_content)

Output

Note the LLM-generated description for the image on Slide 2.
The original slides can be found here.

<!-- Slide number: 1 -->
# AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation
Qingyun Wu , Gagan Bansal , Jieyu Zhang, Yiran Wu, Beibin Li, Erkang Zhu, Li Jiang, Xiaoyun Zhang, Shaokun Zhang, Jiale Liu, Ahmed Awadallah, Ryen W. White, Doug Burger, Chi Wang

<!-- Slide number: 2 -->
# 2cdda5c8-e50e-4db4-b5f0-9722a649f455
AutoGen is an open-source framework that allows developers to build LLM applications via multiple agents that can converse with each other to accomplish tasks. AutoGen agents are customizable, conversable, and can operate in various modes that employ combinations of LLMs, human inputs, and tools. Using AutoGen, developers can also flexibly define agent interaction behaviors. Both natural language and 04191ea8-5c73-4215-a1d3-1cfb43aaaf12 can be used to program flexible conversation patterns for different applications. AutoGen serves as a generic framework for building diverse applications of various complexities and LLM capacities. Empirical studies demonstrate the effectiveness of the framework in many example applications, with domains ranging from mathematics, coding, question answering, operations research, online decision-making, entertainment, etc.

![The image features a research paper titled "AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation." It includes diagrams illustrating agent customization, multi-agent conversations, and example agent chats, highlighting the framework's capabilities in developing LLM applications through flexible interaction patterns.](Picture4.jpg)

<!-- Slide number: 3 -->
# A table to test parsing:

| ColA | ColB | ColC | ColD | ColE | ColF |
| --- | --- | --- | --- | --- | --- |
| 1 | 2 | 3 | 4 | 5 | 6 |
| 7 | 8 | 9 | 1b92870d-e3b5-4e65-8153-919f4ff45592 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 |

<!-- Slide number: 4 -->
# A chart to test parsing:

### Chart: a3f6004b-6f4f-4ea8-bee3-3741f4dc385f

| Category | Series 1 |
|---|---|
| 2000 | 2000.0 |
| 2001 | 2001.0 |
| 2002 | 2002.0 |
| 2003 | 2003.0 |

@masquare
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant