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

Summary overwritting content #412

Open
otisscott opened this issue Nov 15, 2023 · 0 comments
Open

Summary overwritting content #412

otisscott opened this issue Nov 15, 2023 · 0 comments

Comments

@otisscott
Copy link

otisscott commented Nov 15, 2023

I am looking to pull the entirety of an articles content so that I can summarize it using ChatGPT. However, for every entry it appears that content is populated with the same small excerpt from the article that is contained within the summary key.

For example when pulling from this url
I get this output inside of content:
'... <b>Boehringer Ingelheim</b>, and others. Promising Diabetic Retinopathy Pipeline Therapies in the various stages of development include Runcaciguat&nbsp;...'

The following is the code that I am using, with self.urls simply being a list of RSS feeds that I am trying to parse.

def grab_content(self, inclusions=None):
        cleaned_list = []
        for feed in self.urls:
            data = parse(feed)
            entries = data['entries']
            for content in entries:
                url, title, date, body = (content['link'].split('url=')[1], cleanhtml(content['title']),
                                          content['published_parsed'], cleanhtml(content['content'][0].value))
                test = content
                if inclusions:
                    if any(exc in title for exc in inclusions) or any(exc in body for exc in inclusions):
                        if "publisher" in content:
                            publisher = content['publisher']
                        else:
                            publisher = None
                        new_article = Article(title, date, body.split('. ')[:4], url, publisher)
                        cleaned_list.append(new_article)
        self.articles += cleaned_list

Please let me know if I am doing anything wrong as I have tried to follow the documentation as best as possible.

Thanks,
Otis

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

No branches or pull requests

1 participant