Spaces:
Sleeping
Sleeping
Delete main.py
Browse files
main.py
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
from tweet_analyzer import TweetDatasetProcessor
|
2 |
-
|
3 |
-
def main():
|
4 |
-
processor = TweetDatasetProcessor()
|
5 |
-
|
6 |
-
# Get PDF path from user
|
7 |
-
pdf_path = input("Enter the path to your PDF file containing tweets: ")
|
8 |
-
|
9 |
-
try:
|
10 |
-
# Process PDF
|
11 |
-
print("Extracting text from PDF...")
|
12 |
-
text = processor.extract_text_from_pdf(pdf_path)
|
13 |
-
|
14 |
-
print("Processing tweets...")
|
15 |
-
df = processor.process_pdf_content(text)
|
16 |
-
print(f"Processed {len(df)} tweets and saved to 'processed_tweets.csv'")
|
17 |
-
|
18 |
-
# Analyze personality
|
19 |
-
print("\nAnalyzing personality profile...")
|
20 |
-
personality_analysis = processor.analyze_personality()
|
21 |
-
print("\nPersonality Analysis:")
|
22 |
-
print(personality_analysis)
|
23 |
-
|
24 |
-
# Interactive tweet generation
|
25 |
-
while True:
|
26 |
-
print("\nOptions:")
|
27 |
-
print("1. Generate tweet with current context")
|
28 |
-
print("2. Generate tweet without context")
|
29 |
-
print("3. Exit")
|
30 |
-
|
31 |
-
choice = input("\nEnter your choice (1-3): ")
|
32 |
-
|
33 |
-
if choice == '3':
|
34 |
-
break
|
35 |
-
elif choice == '1':
|
36 |
-
context = input("\nEnter current context or topic: ")
|
37 |
-
new_tweet = processor.generate_tweet(context)
|
38 |
-
else:
|
39 |
-
new_tweet = processor.generate_tweet()
|
40 |
-
|
41 |
-
print("\nGenerated Tweet:")
|
42 |
-
print(new_tweet)
|
43 |
-
|
44 |
-
except Exception as e:
|
45 |
-
print(f"An error occurred: {str(e)}")
|
46 |
-
|
47 |
-
if __name__ == "__main__":
|
48 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|