Comments (6)
in text_pp.py file change your parse_response function with this following code good luck
def parse_response(response):
slides = response.split('\n\n')
slides_content = []
for slide in slides:
lines = slide.split('\n')
title_line = lines[0]
if ': ' in title_line:
title = title_line.split(': ', 1)[1] # Extract the title after 'Slide X: '
else:
title = title_line
content_lines = [line for line in lines[1:] if line != 'Content:'] # Skip line if it is 'Content:'
content = '\n'.join(content_lines) # Join the lines to form the content
# Extract the keyword from the line that starts with 'Keyword:' or 'Keywords:'
keyword_lines = [line for line in lines if 'Keyword:' in line or 'Keywords:' in line]
if keyword_lines:
keyword_line = keyword_lines[0]
keyword = keyword_line.split(': ', 1)[1]
else:
keyword = "" # Set a default value if no keyword is found
slides_content.append({'title': title, 'content': content, 'keyword': keyword})
return slides_content
from powerpoint-generator-python-project.
I'll check it out and fix it, thank for pointing out! :)
from powerpoint-generator-python-project.
from powerpoint-generator-python-project.
Feel free to make a pull request or issues, and be a contributor of the project!
from powerpoint-generator-python-project.
If you check the terminal, gpt response looks like this.(content is just one example)
Slide 1: Introduction to Information Technology
Content:
- Definition and importance of Information Technology
- Role of IT in businesses and organizations
- Various components and applications of IT
- Benefits of adopting IT in the workplace
Keywords: Information Technology, Introduction
Slide 2: Emerging Trends in Information Technology
Content:
- Cloud computing and its advantages
- Artificial Intelligence and machine learning
- Internet of Things and its implications
- Big Data and analytics
Keywords: Emerging Trends, Information Technology
And if the format is like Slide<slide_number>: Content: <something...> Keywords:<something...> so can you check the terminal? If you can see this format, you are supposed to generate powerpoint. Keyword is used for querying the image. After you check this, let me know the result 👍
from powerpoint-generator-python-project.
from powerpoint-generator-python-project.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerpoint-generator-python-project.