Giter Site home page Giter Site logo

Comments (6)

moonzaidi7262 avatar moonzaidi7262 commented on June 14, 2024

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.

otahina avatar otahina commented on June 14, 2024

I'll check it out and fix it, thank for pointing out! :)

from powerpoint-generator-python-project.

moonzaidi7262 avatar moonzaidi7262 commented on June 14, 2024

from powerpoint-generator-python-project.

otahina avatar otahina commented on June 14, 2024

Feel free to make a pull request or issues, and be a contributor of the project!

from powerpoint-generator-python-project.

otahina avatar otahina commented on June 14, 2024

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.

moonzaidi7262 avatar moonzaidi7262 commented on June 14, 2024

from powerpoint-generator-python-project.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.