Python.science
7.29K subscribers
1 photo
21 files
12 links
Download Telegram
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression

# Sample training data (manually added)
texts = [
"NASA finds water on Mars",
"Apple launches new iPhone with AI",
"Aliens have landed in Delhi",
"Government bans all smartphones",
"COVID-19 vaccine approved worldwide",
"World ends tomorrow",
"Elon Musk buys the Moon",
"UN announces global peace treaty",
]
labels = ["REAL", "REAL", "FAKE", "FAKE", "REAL", "FAKE", "FAKE", "REAL"]

# Step 1: Preprocess
vectorizer = TfidfVectorizer()
X = vectorizer.fit_transform(texts)

# Step 2: Train model
model = LogisticRegression()
model.fit(X, labels)

# Step 3: Take input and predict
headline = input("πŸ“° Enter a news headline: ")
headline_vec = vectorizer.transform([headline])
prediction = model.predict(headline_vec)

print(" This news is:", "FAKE " if prediction[0] == "FAKE" else "REAL ")
❀10πŸ”₯6πŸ‘2
Fake News Detector ☝️
πŸ‘7❀1
from instabot import Bot

bot = Bot()

#Login
bot.login(username="your_username", password="your_password")
#Don't use your main account because it might get affected!
#Create a demo account for test purpose!

#Follow a user
bot.follow("elonmusk")

#comment
bot.comment("coding","Great content!")

#send DM to someone
bot.send_message("Hey! Big fan",["python.science","only_programming"])
❀7πŸ”₯3
Instagram Bot
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY")

messages = [
{"role": "system", "content": "You are an intelligent assistant."}
]

while True:
message = input("User : ")
if message:
messages.append({"role": "user", "content": message})

chat = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=messages
)

reply = chat.choices[0].message.content
print(f"ChatGPT: {reply}")

messages.append({"role": "assistant", "content": reply})
❀7😱4
Chatbot using python
# YT Complete Playlist Download
from pytube import Playlist

p = Playlist("https://www.youtube.com/playlist?list=PLxgZQoSe9cg00xClkch7Gr")

for video in p.videos:
video.streams.first().download()
❀4😒4
I really wish my seniors told me about these websites before my final year πŸ‘‡

1/ NotebookLM:
Upload your study notes or articles and instantly turn them into podcasts.
https://notebooklm.google/

2/ Writefull:
Specially trained on journals to improve your academic writing and works seamlessly with Overleaf & Word.
https://www.writefull.com/

3/ Undetectable AI:
Upload your study notes and get text that sounds natural and authentic.
https://undetectable.ai/?dv=ca&peoc=true

4/ PDF Drive:
Access all the books and articles you need for school or college in one place.
https://pdfdrive.com.co/

5/ Writefull:
Specially trained on journals to improve your academic writing - and works seamlessly with Overleaf & Word.
https://mapify.so/
❀5
πŸš€ 75 Days LeetCode Challenge

Innoverse Coding Club is organizing a 75 Days LeetCode Challenge focused on building consistency, DSA problem-solving skills, and interview preparation.

πŸ“… Duration: 75 Days
πŸ’» Mode: Online (Daily questions on Discord)

πŸ† Prizes:
πŸ₯‡ Winner gets β‚Ή5000 Cash Prize
πŸ’Ό Chance for Paid Internship at Cachebugs (Developer Role)

πŸŽ“ Certificates:
All participants who successfully complete the challenge will receive an official certificate.

If you’re serious about DSA, placements, and coding discipline β€” this is for you.

πŸ“© Apply Now: https://unstop.com/p/75-days-leetcode-challenge-chandigarh-university-cu-unnao-1641964

πŸ“² WhatsApp Group Joining Link: https://chat.whatsapp.com/JPtV7wOCNXeDCjNIffM0yz

πŸ”₯ How it works:
* 1 LeetCode problem will be shared daily
* Solve it within 24 hours
* Maintain your streak
* We’ll track consistency & performance

Limited serious participants only.
❀4