Пікірлер
@lordist52
@lordist52 18 күн бұрын
very understandable. Thanks for this video.
@vartetalearningplatform2271
@vartetalearningplatform2271 21 күн бұрын
Here is the code folks: import pandas as pd from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import train_test_split from sklearn.naive_bayes import MultinomialNB from sklearn.metrics import accuracy_score, classification_report, confusion_matrix from sklearn.compose import ColumnTransformer from sklearn.pipeline import Pipeline df = pd.read_csv('sentiment_multifeaturedata.csv') # Define columns for feature extraction text_cols = ['Text', 'Explanation','SpecificPhraseWord','Category'] # Split data into training and testing sets X_train, X_test, y_train, y_test = train_test_split(df[text_cols], df['Sentiment'], test_size=0.2, random_state=42) # Create pipeline with ColumnTransformer and MultinomialNB pipeline = Pipeline([ ('vectorizer', ColumnTransformer([ ('text_vectorizer', TfidfVectorizer(stop_words='english'), 'Text'), ('expl_vectorizer', TfidfVectorizer(stop_words='english'), 'Explanation'), ('phrase_vectorizer', TfidfVectorizer(stop_words='english'), 'SpecificPhraseWord'), ('cat_vectorizer', TfidfVectorizer(stop_words='english'), 'Category') ])), ('clf', MultinomialNB()) ]) # Train pipeline on training data pipeline.fit(X_train, y_train) # Make predictions on testing data y_pred = pipeline.predict(X_test) # Evaluate pipeline performance print("Accuracy:", accuracy_score(y_test, y_pred)) print("Classification Report:") print(classification_report(y_test, y_pred)) print("Confusion Matrix:") print(confusion_matrix(y_test, y_pred)) #Predict the output on the input data from user: while True: user_input = input("Enter your text: ") # Create a DataFrame with user input user_df = pd.DataFrame([user_input], columns=['Text']) # Add other columns (Explanation, SpecificPhraseWord, Category) if necessary user_df['Explanation'] = '' user_df['SpecificPhraseWord'] = '' user_df['Category'] = '' # Use pipeline to predict sentiment user_prediction = pipeline.predict(user_df) # Print predicted sentiment print("Predicted Sentiment:", user_prediction[0])
@govindkaushik7967
@govindkaushik7967 25 күн бұрын
this video gave lot of understanding🙏
@govindkaushik7967
@govindkaushik7967 25 күн бұрын
thank you sir
@fanforeverclips
@fanforeverclips Ай бұрын
is it Complete Playlist for socket programming ?
@manishpatil331
@manishpatil331 Ай бұрын
Thanks for video😊
@umarfarooque8293
@umarfarooque8293 Ай бұрын
Sir I want to learn Boost.ASIO from basic to Advanced. Please make a playlist for Boost.ASIO
@AkshayKumar-eu3yp
@AkshayKumar-eu3yp Ай бұрын
Would Like to Recommend this series to all who want to make their career in AI Filed
@AkshayKumar-eu3yp
@AkshayKumar-eu3yp Ай бұрын
Awesome sir
@marinielgalvao5259
@marinielgalvao5259 Ай бұрын
For me select(nMaxFd + 1, &fr, &fw, &fe, &tv); always returns 0...
@etis3129
@etis3129 Ай бұрын
Hi Sir if i want to use IPROTO_SCTP instead of IPROTO_TCP will it work or do i have to change the program as well?
@vartetalearningplatform2271
@vartetalearningplatform2271 Ай бұрын
It should work
@vartetalearningplatform2271
@vartetalearningplatform2271 Ай бұрын
Code: import nltk from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_bayes import MultinomialNB '''' You can ask the available models to generate the text and sentiment for you for varioud moods. Generate it in various categories like delay, wrong response, ''' # Load the dataset (assuming a CSV file with 'text' and 'sentiment' columns) import pandas as pd df = pd.read_csv('sentiment_data.csv') # Tokenize the text data nltk.download('punkt') nltk.download('wordnet') nltk.download('stopwords') lemmatizer = WordNetLemmatizer() stop_words = set(stopwords.words('english')) def preprocess_text(text): tokens = word_tokenize(text) tokens = [t for t in tokens if t.isalpha()] tokens = [lemmatizer.lemmatize(t) for t in tokens] tokens = [t for t in tokens if t not in stop_words] return ' '.join(tokens) df['text'] = df['text'].apply(preprocess_text) # Split data into training and testing sets X = df['text'] y = df['sentiment'] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) # Vectorize the text data using TF-IDF vectorizer = TfidfVectorizer() X_train_tfidf = vectorizer.fit_transform(X_train) X_test_tfidf = vectorizer.transform(X_test) cVectorizer = CountVectorizer() X_train_count = cVectorizer.fit_transform(X_train) X_test_count = cVectorizer.transform(X_test) # Initialize the Multinomial Naive Bayes classifier clf = MultinomialNB() # Train the classifier using the training data clf.fit(X_train_count, y_train) # Define a function to predict the sentiment of a user's input def predict_sentiment(text): text_count = vectorizer.transform([text]) prediction = clf.predict(text_count) return prediction[0] # Test the function user_input = input("Enter your text: ") print(predict_sentiment(user_input))
@mastermind9711
@mastermind9711 2 ай бұрын
Thank you sir, looking forward to this series. Also sir if possible, could you please make some tutorials on drogon or crow framework for c++?
@vartetalearningplatform2271
@vartetalearningplatform2271 Ай бұрын
Sure
@mastermind9711
@mastermind9711 Ай бұрын
@@vartetalearningplatform2271 Thank you very much sir!
@VinodPatel-s8x
@VinodPatel-s8x 2 ай бұрын
Vikas sir,IPC aur multithreading pe bhi vedio banaiye
@rinkiradigo
@rinkiradigo 2 ай бұрын
Highly recommend watching it 👍
@KRISHNAKUMAR-hi4ii
@KRISHNAKUMAR-hi4ii 2 ай бұрын
sir why my code is not working in vs code
@infini6338
@infini6338 2 ай бұрын
The message is not received at server from client. The server stops after sending sending acknowledgement of connection received. I cannot send first message from client to server. The nRet of server becomes zero..
@infini6338
@infini6338 2 ай бұрын
the program is not working winsock2.h file not found error
@anil84200308
@anil84200308 2 ай бұрын
I think, it would be better Toolbox, solution explorer can be minimized so that code editor look bigger.
@ronit172
@ronit172 3 ай бұрын
You have channel Viswaguru
@amangelool
@amangelool 3 ай бұрын
Parentheses are not needed or recommended based on what I read.
@DeepF-r5g
@DeepF-r5g 3 ай бұрын
Wonderful example. Hidden gem.
@Moto-iz4cj
@Moto-iz4cj 4 ай бұрын
File access in C padhayiye, please.
@adityasoni7572
@adityasoni7572 4 ай бұрын
Awesome
@Moto-iz4cj
@Moto-iz4cj 5 ай бұрын
Yadi aap nahi padhana chahte to bhi bass ye 3 topics indepth me padha dijiye jaise aap padhate ho, Please. 1. Memory Management 2. File Access 3. Structs
@vartetalearningplatform2271
@vartetalearningplatform2271 4 ай бұрын
ओके.. मै देखता हूँ
@Moto-iz4cj
@Moto-iz4cj 4 ай бұрын
@@vartetalearningplatform2271 thank you, sir
@Moto-iz4cj
@Moto-iz4cj 5 ай бұрын
Sir, please next video bhi lao na.
@Yan-yx5nb
@Yan-yx5nb 5 ай бұрын
you just need a std:thread or creatthread ,and you can implent this.
@aditya.singhal
@aditya.singhal 5 ай бұрын
counter should not be handled using static keyword as it will be common for all instances of the shared_ptr class. This will not work when I create a instance of shared_ptr class to point to a new int resource in the memory.
@_v0id309
@_v0id309 5 ай бұрын
I am creating a network scanner in c++ so I needed to learn about sockets and I saw your playlist , it's actually amazing sir ❤ lot's of love ❤
@Enerzon
@Enerzon 6 ай бұрын
Sir, Bas itna hi hai kya C programming me ??
@vartetalearningplatform2271
@vartetalearningplatform2271 6 ай бұрын
कोई व्यू नहीं आ रहे भाई...
@Enerzon
@Enerzon 5 ай бұрын
@@vartetalearningplatform2271 Samajh sakta hu, par main to padhta hu na. Aap banate raho video, Please...
@greydogyoutube
@greydogyoutube 6 ай бұрын
wtf! this is ms documentation!
@bigdatapartner
@bigdatapartner 6 ай бұрын
ASW LECTURE.EASY TO UNDERSTAND . GOOD FOR BEGINNERS
@RaveedUllahUsmani
@RaveedUllahUsmani 6 ай бұрын
what is the purpose of MaxFd?
@chiragsharma154
@chiragsharma154 6 ай бұрын
Nicely explain. Understood the Lambda now.
@kaoutariabakriman3061
@kaoutariabakriman3061 6 ай бұрын
Please can you give us a the code source.I write the same thing but i find mistakes in my code .I didn't get the same answer you get
@manishpatil331
@manishpatil331 7 ай бұрын
Could you make a video on design patterns please ?
@manishpatil331
@manishpatil331 7 ай бұрын
Thanks for video
@amarnathgandhi2426
@amarnathgandhi2426 7 ай бұрын
Hi vikas sir Could you help me to clear one doubt Suppose if have a interger vector contains some duplicate values i want to remove these value without change the order of vector elements how i can ?? Pls help me sir
@vartetalearningplatform2271
@vartetalearningplatform2271 7 ай бұрын
You are talking about the vectors in STL?
@amarnathgandhi2426
@amarnathgandhi2426 7 ай бұрын
Yes sir
@messager3000
@messager3000 7 ай бұрын
Thank you for these videos, I progressed a lot thanks to you !
@Enerzon
@Enerzon 8 ай бұрын
Sir, scanf() returns number Of Input scanned. Ye maine Reverse-Engeneering me padha tha.
@vartetalearningplatform2271
@vartetalearningplatform2271 8 ай бұрын
Great!! That's the right answer!!
@Enerzon
@Enerzon 8 ай бұрын
Sir, I've a confusion. Pehle value increase hoti hai and then wo compair hoti hai to jab loop me k=10 tha to wo increment Hokar 11 ho gayi. 11 is not <=10 to is condition me to while statement false ho gayi na to while ke under printf() execute nahi honi chahiye.
@Enerzon
@Enerzon 8 ай бұрын
I think, Pehle compair hoti hai then increase and then print. 1<=10 -------> 1++ ------> 2----> printf. 10<=10 ------> 10++ -----> 11---> printf.
@vartetalearningplatform2271
@vartetalearningplatform2271 8 ай бұрын
@@Enerzon yes, saare kaam ek line me ho jaate hain..++ ka rule waise hee kaam karta hai ki pahle operation perform karo and then increment
@Enerzon
@Enerzon 8 ай бұрын
conio.h unidentified header file bata raha hai, GCC me ???
@vartetalearningplatform2271
@vartetalearningplatform2271 8 ай бұрын
Yes in gcc it may not be there
@Enerzon
@Enerzon 8 ай бұрын
Sir, every Sunday ko excercise video. Aur Ham aage system calls bhi padhenge na??
@gp076vikashshakya9
@gp076vikashshakya9 8 ай бұрын
Yes
@Enerzon
@Enerzon 8 ай бұрын
Sir, Ham system calls bhi padhenge na ???
@gp076vikashshakya9
@gp076vikashshakya9 8 ай бұрын
Unix wali?
@NeelamSomannavar
@NeelamSomannavar 8 ай бұрын
kindly mention the IDE used for socket programming
@vartetalearningplatform2271
@vartetalearningplatform2271 8 ай бұрын
Use Visual Studio 2022
@sarael8261
@sarael8261 8 ай бұрын
sous-titres please
@Enerzon
@Enerzon 8 ай бұрын
Sir, please continuously video daliye. 1 video per Day.
@chryselysdemo
@chryselysdemo 8 ай бұрын
@vartetalearningplatform2271 Can we pass a custom response format as prompt for this agent?
@vartetalearningplatform2271
@vartetalearningplatform2271 8 ай бұрын
Yes
@vartetalearningplatform2271
@vartetalearningplatform2271 8 ай бұрын
The code is here: from langchain.agents.agent_types import AgentType from langchain_experimental.agents.agent_toolkits import create_csv_agent from langchain_openai import ChatOpenAI, OpenAI import os agent = create_csv_agent( ChatOpenAI(api_key = os.environ.get('OPENAI_API_KEY'), temperature=0, model="gpt-3.5-turbo-0613"), "churn.csv", verbose=True, agent_type=AgentType.OPENAI_FUNCTIONS, handle_parsing_errors = True, ) user_input = input('Please ask your question:') agent.invoke(user_input)
@vartetalearningplatform2271
@vartetalearningplatform2271 8 ай бұрын
from langchain.prompts import PromptTemplate from langchain.llms import OpenAI from langchain.chains import LLMChain from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder import os user_input = input("Enter a topic: ") prompt = ChatPromptTemplate.from_messages( [ ( "system", "You are very powerful assistant, but can't answer anything on General Knowledge", ), ("user", "Give the answer to this topic: {topic}"), ] ) llm = OpenAI(api_key= os.environ.get('OPENAI_API_KEY'), temperature = 0) chain = LLMChain(llm=llm, prompt=prompt) output = chain.run(user_input) print(output)