Spaces:
Sleeping
Sleeping
Delete main.py
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748from tweet_analyzer import TweetDatasetProcessor
def main(): processor = TweetDatasetProcessor() # Get PDF path from user pdf_path = input("Enter the path to your PDF file containing tweets: ") try: # Process PDF print("Extracting text from PDF...") text = processor.extract_text_from_pdf(pdf_path) print("Processing tweets...") df = processor.process_pdf_content(text) print(f"Processed {len(df)} tweets and saved to 'processed_tweets.csv'") # Analyze personality print("\nAnalyzing personality profile...") personality_analysis = processor.analyze_personality() print("\nPersonality Analysis:") print(personality_analysis) # Interactive tweet generation while True: print("\nOptions:") print("1. Generate tweet with current context") print("2. Generate tweet without context") print("3. Exit") choice = input("\nEnter your choice (1-3): ") if choice == '3': break elif choice == '1': context = input("\nEnter current context or topic: ") new_tweet = processor.generate_tweet(context) else: new_tweet = processor.generate_tweet() print("\nGenerated Tweet:") print(new_tweet) except Exception as e: print(f"An error occurred: {str(e)}")
if __name__ == "__main__": main()main.pyDeleted-48