forked from Semutireng22/kiteai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrand.py
More file actions
71 lines (63 loc) · 3.28 KB
/
rand.py
File metadata and controls
71 lines (63 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import json
import random
# List of keywords based on category
keywords = {
"ai": [
"AI", "machine learning", "neural networks", "AI ethics", "AI governance",
"AI-powered trading", "automated decision-making", "AI-driven security",
"natural language processing", "computer vision", "reinforcement learning",
"AI in healthcare", "AI in finance", "AI in education", "AI in robotics"
],
"crypto": [
"blockchain", "smart contracts", "NFT", "DeFi", "DAO", "consensus mechanism",
"public ledger", "crypto wallet", "Ethereum", "Bitcoin", "staking",
"cryptographic algorithms", "tokenomics", "crypto regulations", "crypto mining",
"crypto exchanges", "initial coin offerings", "stablecoins"
],
"fraud_detection": [
"identify fraudulent transactions", "security concerns", "zero-knowledge proofs",
"transparency", "game theory in crypto", "privacy coins", "oracles",
"anomaly detection", "behavioral analytics", "fraud prevention strategies",
"biometric authentication", "multi-factor authentication", "risk assessment",
"transaction monitoring", "fraud detection algorithms"
]
}
# Additional phrases for question variations
extra_phrases = [
"in the future", "impact on economy", "challenges faced", "advantages and disadvantages",
"real-world applications", "security concerns", "scalability issues", "role in financial markets",
"integration with IoT", "comparison with traditional systems", "future predictions",
"ethical concerns", "adoption by enterprises", "potential for mass adoption"
]
# Starters for different question structures
starters = [
"What is", "How does", "Why is", "Can you explain", "What are the benefits of",
"How can", "What makes", "What are the features of", "How does", "What is the purpose of",
"Why should we use", "What are the risks of", "What are the future prospects of",
"Discuss the role of", "Analyze the impact of", "Explain the concept of"
]
# Additional contexts for variation
contexts = ["in today's world", "for businesses", "for individuals", "in technology"]
# Function to generate a random question based on a topic
def generate_random_question(topic):
random_starter = random.choice(starters)
random_keyword = random.choice(keywords[topic])
random_extra = random.choice(extra_phrases)
random_context = random.choice(contexts)
return f"{random_starter} {random_keyword} {random_extra} {random_context}?"
# Function to generate a set number of random questions per topic
def generate_questions_per_topic(count):
questions = {
"ai": [generate_random_question("ai") for _ in range(count)],
"crypto": [generate_random_question("crypto") for _ in range(count)],
"fraud_detection": [generate_random_question("fraud_detection") for _ in range(count)]
}
return questions
# Number of questions to generate per topic
question_count_per_topic = 500
# Generate questions and save to a JSON file
if __name__ == "__main__":
questions_by_topic = generate_questions_per_topic(question_count_per_topic)
with open("random_questions.json", "w") as f:
json.dump(questions_by_topic, f, indent=2)
print(f"{question_count_per_topic} random questions per topic have been saved in random_questions.json")