{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport pandas_profiling as pp\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-11-12T16:17:47.436868Z","iopub.execute_input":"2022-11-12T16:17:47.437662Z","iopub.status.idle":"2022-11-12T16:17:50.931371Z","shell.execute_reply.started":"2022-11-12T16:17:47.437537Z","shell.execute_reply":"2022-11-12T16:17:50.929969Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train=pd.read_csv('/kaggle/input/clickbait-news-detection/train.csv')\ntest=pd.read_csv('/kaggle/input/clickbait-news-detection/test.csv')\ntrain","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:50.9343Z","iopub.execute_input":"2022-11-12T16:17:50.934817Z","iopub.status.idle":"2022-11-12T16:17:53.760827Z","shell.execute_reply.started":"2022-11-12T16:17:50.934759Z","shell.execute_reply":"2022-11-12T16:17:53.759242Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:53.762242Z","iopub.execute_input":"2022-11-12T16:17:53.762602Z","iopub.status.idle":"2022-11-12T16:17:53.779942Z","shell.execute_reply.started":"2022-11-12T16:17:53.76257Z","shell.execute_reply":"2022-11-12T16:17:53.778428Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#pp.ProfileReport(test)","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:53.784058Z","iopub.execute_input":"2022-11-12T16:17:53.785535Z","iopub.status.idle":"2022-11-12T16:17:53.792928Z","shell.execute_reply.started":"2022-11-12T16:17:53.785479Z","shell.execute_reply":"2022-11-12T16:17:53.791479Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['title'].fillna('missing',inplace=True)\ntest['title'].fillna('missing',inplace=True)","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:53.794382Z","iopub.execute_input":"2022-11-12T16:17:53.794789Z","iopub.status.idle":"2022-11-12T16:17:53.815961Z","shell.execute_reply.started":"2022-11-12T16:17:53.794746Z","shell.execute_reply":"2022-11-12T16:17:53.814728Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import re\nfrom string import punctuation\ndef textprocess(title):\n    result=title.replace('/',\"\").replace('\\n','')\n    result=re.sub(r'[0-9]+','number',result)\n    result=re.sub(r'(\\w)(\\1{2,})',r'\\1',result)\n    result=re.sub(r'(?x)\\b(?=\\w*\\d)\\w+\\s*', '', result)\n    result=\"\".join(word for word in result if word not in punctuation)\n    re.sub(r' +',' ',result).lower().strip()\n    return result","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:53.817433Z","iopub.execute_input":"2022-11-12T16:17:53.818324Z","iopub.status.idle":"2022-11-12T16:17:53.831812Z","shell.execute_reply.started":"2022-11-12T16:17:53.818281Z","shell.execute_reply":"2022-11-12T16:17:53.830876Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from nltk.corpus import stopwords\nstop=stopwords.words('english')\ndef stop_words(title):\n    result1=title.split()\n    num1=len([word for word in result1 if word in stop])\n    return num1","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:53.833852Z","iopub.execute_input":"2022-11-12T16:17:53.834285Z","iopub.status.idle":"2022-11-12T16:17:54.809468Z","shell.execute_reply.started":"2022-11-12T16:17:53.834237Z","shell.execute_reply":"2022-11-12T16:17:54.808152Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"contraction= ['tis', 'aint', 'amnt', 'arent', 'cant', 'couldve', 'couldnt', 'couldntve',\n                'didnt', 'doesnt', 'dont', 'gonna', 'gotta', 'hadnt', 'hadntve', 'hasnt',\n                'havent', 'hed', 'hednt', 'hedve', 'hell', 'hes', 'hesnt', 'howd', 'howll',\n                'hows', 'id', 'idnt', 'idntve', 'idve', 'ill', 'im', 'ive', 'ivent', 'isnt',\n                'itd', 'itdnt', 'itdntve', 'itdve', 'itll', 'its', 'itsnt', 'mightnt',\n                'mightve', 'mustnt', 'mustntve', 'mustve', 'neednt', 'oclock', 'ol', 'oughtnt',\n                'shant', 'shed', 'shednt', 'shedntve', 'shedve', 'shell', 'shes', 'shouldve',\n                'shouldnt', 'shouldntve', 'somebodydve', 'somebodydntve', 'somebodys',\n                'someoned', 'someonednt', 'someonedntve', 'someonedve', 'someonell', 'someones',\n                'somethingd', 'somethingdnt', 'somethingdntve', 'somethingdve', 'somethingll',\n                'somethings', 'thatll', 'thats', 'thatd', 'thered', 'therednt', 'theredntve',\n                'theredve', 'therere', 'theres', 'theyd', 'theydnt', 'theydntve', 'theydve',\n                'theydvent', 'theyll', 'theyontve', 'theyre', 'theyve', 'theyvent', 'wasnt',\n                'wed', 'wedve', 'wednt', 'wedntve', 'well', 'wontve', 'were', 'weve', 'werent',\n                'whatd', 'whatll', 'whatre', 'whats', 'whatve', 'whens', 'whered', 'wheres',\n                'whereve', 'whod', 'whodve', 'wholl', 'whore', 'whos', 'whove', 'whyd', 'whyre',\n                'whys', 'wont', 'wontve', 'wouldve', 'wouldnt', 'wouldntve', 'yall', 'yalldve',\n                'yalldntve', 'yallll', 'yallont', 'yallllve', 'yallre', 'yallllvent', 'yaint',\n                'youd', 'youdve', 'youll', 'youre', 'yourent', 'youve', 'youvent']\n\ndef cnt_contract(title):\n    result2=title.split()\n    num2=len([word for word in result2 if word in contraction])\n    return num2","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:54.811115Z","iopub.execute_input":"2022-11-12T16:17:54.811514Z","iopub.status.idle":"2022-11-12T16:17:54.828123Z","shell.execute_reply.started":"2022-11-12T16:17:54.811478Z","shell.execute_reply":"2022-11-12T16:17:54.826716Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_words = ['who', 'whos', 'whose', 'what', 'whats', 'whatre', 'when', 'whenre', 'whens', 'couldnt',\n        'where', 'wheres', 'whered', 'why', 'whys', 'can', 'cant', 'could', 'will', 'would', 'is',\n        'isnt', 'should', 'shouldnt', 'you', 'your', 'youre', 'youll', 'youd', 'here', 'heres',\n        'how', 'hows', 'howd', 'this', 'are', 'arent', 'which', 'does', 'doesnt']\ndef isquestion(title):\n    result3=title.lower().split()\n    if result3[0] in question_words:\n        return 1\n    else:\n        return 0","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:54.829782Z","iopub.execute_input":"2022-11-12T16:17:54.830192Z","iopub.status.idle":"2022-11-12T16:17:54.850498Z","shell.execute_reply.started":"2022-11-12T16:17:54.830106Z","shell.execute_reply":"2022-11-12T16:17:54.849045Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def pos_tags(title):\n    result4=title.split()\n    non_stop=[word for word in result4 if word not in stopwords.words(\"english\")]\n    pos=[part[1] for part in nltk.pos_tag(non_stop)]\n    pos=\" \".join(pos)\n    return pos","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:54.854938Z","iopub.execute_input":"2022-11-12T16:17:54.85555Z","iopub.status.idle":"2022-11-12T16:17:54.866746Z","shell.execute_reply.started":"2022-11-12T16:17:54.855514Z","shell.execute_reply":"2022-11-12T16:17:54.865466Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import nltk\nfrom tqdm import tqdm,tqdm_notebook\ntqdm.pandas()\n\ntrain['processed_headline']=train['title'].progress_apply(textprocess)\ntrain['question']=train['title'].progress_apply(isquestion)\ntrain['num_words']=train['title'].progress_apply(lambda x: len(x.split()))\ntrain['part_speech']=train['title'].progress_apply(pos_tags)\ntrain['num_contract']=train['title'].progress_apply(cnt_contract)\ntrain['num_stopwords']=train['title'].progress_apply(stop_words)\ntrain['stop_word_ratio']=train['num_stopwords']/train['num_words']\ntrain['contract_ratio']=train['num_contract']/train['num_words']","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:17:54.8683Z","iopub.execute_input":"2022-11-12T16:17:54.868637Z","iopub.status.idle":"2022-11-12T16:18:55.060718Z","shell.execute_reply.started":"2022-11-12T16:17:54.868606Z","shell.execute_reply":"2022-11-12T16:18:55.059775Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import nltk\nfrom tqdm import tqdm,tqdm_notebook\ntqdm.pandas()\n\ntest['processed_headline']=test['title'].progress_apply(textprocess)\ntest['question']=test['title'].progress_apply(isquestion)\ntest['num_words']=test['title'].progress_apply(lambda x: len(x.split()))\ntest['part_speech']=test['title'].progress_apply(pos_tags)\ntest['num_contract']=test['title'].progress_apply(cnt_contract)\ntest['num_stopwords']=test['title'].progress_apply(stop_words)\ntest['stop_word_ratio']=test['num_stopwords']/test['num_words']\ntest['contract_ratio']=test['num_contract']/test['num_words']","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:18:55.062108Z","iopub.execute_input":"2022-11-12T16:18:55.062412Z","iopub.status.idle":"2022-11-12T16:19:11.316626Z","shell.execute_reply.started":"2022-11-12T16:18:55.062383Z","shell.execute_reply":"2022-11-12T16:19:11.314877Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:11.318313Z","iopub.execute_input":"2022-11-12T16:19:11.318714Z","iopub.status.idle":"2022-11-12T16:19:11.34589Z","shell.execute_reply.started":"2022-11-12T16:19:11.318679Z","shell.execute_reply":"2022-11-12T16:19:11.344906Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:11.347145Z","iopub.execute_input":"2022-11-12T16:19:11.3484Z","iopub.status.idle":"2022-11-12T16:19:11.373524Z","shell.execute_reply.started":"2022-11-12T16:19:11.348312Z","shell.execute_reply":"2022-11-12T16:19:11.371936Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train=train.drop(columns=['num_contract','num_stopwords'])\ntest=test.drop(columns=['num_contract','num_stopwords'])","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:11.377861Z","iopub.execute_input":"2022-11-12T16:19:11.378244Z","iopub.status.idle":"2022-11-12T16:19:11.407352Z","shell.execute_reply.started":"2022-11-12T16:19:11.378213Z","shell.execute_reply":"2022-11-12T16:19:11.406231Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.feature_extraction.text import TfidfVectorizer\n\ntfidf = TfidfVectorizer(min_df=3, max_features=None, strip_accents='unicode',analyzer='word', token_pattern=r'\\w{1,}', ngram_range=(1,5),use_idf=1, smooth_idf=1, sublinear_tf=1)\nX_train_headline=tfidf.fit_transform(train['processed_headline'])\nx_test_headline=tfidf.transform(test['processed_headline'])","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:11.408953Z","iopub.execute_input":"2022-11-12T16:19:11.409566Z","iopub.status.idle":"2022-11-12T16:19:14.269347Z","shell.execute_reply.started":"2022-11-12T16:19:11.40953Z","shell.execute_reply":"2022-11-12T16:19:14.268078Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train_headline","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:14.270886Z","iopub.execute_input":"2022-11-12T16:19:14.271227Z","iopub.status.idle":"2022-11-12T16:19:14.278992Z","shell.execute_reply.started":"2022-11-12T16:19:14.271194Z","shell.execute_reply":"2022-11-12T16:19:14.277735Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x_test_headline","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:14.281022Z","iopub.execute_input":"2022-11-12T16:19:14.281426Z","iopub.status.idle":"2022-11-12T16:19:14.295243Z","shell.execute_reply.started":"2022-11-12T16:19:14.281367Z","shell.execute_reply":"2022-11-12T16:19:14.29395Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['part_speech']","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:14.297711Z","iopub.execute_input":"2022-11-12T16:19:14.298135Z","iopub.status.idle":"2022-11-12T16:19:14.311443Z","shell.execute_reply.started":"2022-11-12T16:19:14.298099Z","shell.execute_reply":"2022-11-12T16:19:14.309847Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.preprocessing import StandardScaler\ncv=CountVectorizer()\nsc=StandardScaler(with_mean=False)\nX_train_pos=cv.fit_transform(train['part_speech'])\nX_train_pos_sc=sc.fit_transform(X_train_pos)\n\nx_test_pos=cv.transform(test['part_speech'])\nx_test_pos_sc=sc.transform(x_test_pos)","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:14.313289Z","iopub.execute_input":"2022-11-12T16:19:14.313827Z","iopub.status.idle":"2022-11-12T16:19:14.588958Z","shell.execute_reply.started":"2022-11-12T16:19:14.313781Z","shell.execute_reply":"2022-11-12T16:19:14.587749Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train_val=train.drop(columns=['title','label','processed_headline','part_speech','text']).values\nx_test_val=test.drop(columns=['title','processed_headline','part_speech','text']).values\nsc=StandardScaler()\nX_train_val_sc=sc.fit_transform(X_train_val)\nx_test_val_sc=sc.transform(x_test_val)","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:14.590398Z","iopub.execute_input":"2022-11-12T16:19:14.591897Z","iopub.status.idle":"2022-11-12T16:19:14.606384Z","shell.execute_reply.started":"2022-11-12T16:19:14.591814Z","shell.execute_reply":"2022-11-12T16:19:14.605009Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.preprocessing import OneHotEncoder\nfrom sklearn.preprocessing import LabelEncoder\nlabel_encoder=LabelEncoder()\nY_train=label_encoder.fit_transform(train[['label']])\nY_train","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:14.607921Z","iopub.execute_input":"2022-11-12T16:19:14.608277Z","iopub.status.idle":"2022-11-12T16:19:14.632408Z","shell.execute_reply.started":"2022-11-12T16:19:14.608246Z","shell.execute_reply":"2022-11-12T16:19:14.630888Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from scipy import sparse\nX_train=sparse.hstack([X_train_pos_sc,X_train_headline,X_train_val_sc]).tocsr()\nx_test=sparse.hstack([x_test_pos_sc,x_test_headline,x_test_val_sc]).tocsr()","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:14.634277Z","iopub.execute_input":"2022-11-12T16:19:14.635166Z","iopub.status.idle":"2022-11-12T16:19:14.692919Z","shell.execute_reply.started":"2022-11-12T16:19:14.635106Z","shell.execute_reply":"2022-11-12T16:19:14.691537Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.linear_model import LogisticRegression\nfrom sklearn.metrics import confusion_matrix,classification_report,accuracy_score\nmodel=LogisticRegression()\nmodel=model.fit(X_train,Y_train)\ny_pred=model.predict(x_test)","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:14.694404Z","iopub.execute_input":"2022-11-12T16:19:14.695913Z","iopub.status.idle":"2022-11-12T16:19:24.126225Z","shell.execute_reply.started":"2022-11-12T16:19:14.695863Z","shell.execute_reply":"2022-11-12T16:19:24.123972Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:24.135927Z","iopub.execute_input":"2022-11-12T16:19:24.136678Z","iopub.status.idle":"2022-11-12T16:19:24.166722Z","shell.execute_reply.started":"2022-11-12T16:19:24.136602Z","shell.execute_reply":"2022-11-12T16:19:24.163733Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lst=[]\nfor i in y_pred:\n    if i==1:\n        x='clickbait'\n    elif x==2:\n        x='news'\n    else:\n        x='others'\n    lst.append(x)\nlst=np.array(lst)\n","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:24.17149Z","iopub.execute_input":"2022-11-12T16:19:24.174535Z","iopub.status.idle":"2022-11-12T16:19:24.208505Z","shell.execute_reply.started":"2022-11-12T16:19:24.174442Z","shell.execute_reply":"2022-11-12T16:19:24.207054Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pickle as pkl\npkl.dump(model,open('model.p','wb'))","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:19:24.212718Z","iopub.execute_input":"2022-11-12T16:19:24.213189Z","iopub.status.idle":"2022-11-12T16:19:24.222232Z","shell.execute_reply.started":"2022-11-12T16:19:24.213149Z","shell.execute_reply":"2022-11-12T16:19:24.2208Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install streamlit\n!pip install pyngrok\nfrom pyngrok import ngrok\n","metadata":{"_kg_hide-output":true,"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-11-12T16:19:24.228744Z","iopub.execute_input":"2022-11-12T16:19:24.229316Z","iopub.status.idle":"2022-11-12T16:20:01.894937Z","shell.execute_reply.started":"2022-11-12T16:19:24.229264Z","shell.execute_reply":"2022-11-12T16:20:01.893092Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n%%writefile Clickbait-detection-app.py\nimport streamlit as st\nimport base64\nimport sklearn\nimport numpy as np\nimport pickle as pkl\nfrom sklearn.preprocessing import MinMaxScaler\nscal=MinMaxScaler()\n#Load the saved model\nmodel=pkl.load(open(\"model.p\",\"rb\"))\n\n\n\n\n\nst.set_page_config(page_title=\"Clickbait detection App\",page_icon=\"\",layout=\"centered\",initial_sidebar_state=\"expanded\")\n\n\n\ndef preprocess(id,title,text):   \n \n    \n    # Pre-processing user input   \n  \n\n\n    user_input=[id,title,text]\n    \n    return prediction\n\n    \n\n       \n    # front end elements of the web page \nhtml_temp = \"\"\" \n    <div style =\"background-color:pink;padding:13px\"> \n    <h1 style =\"color:black;text-align:center;\">Clickbait Detector</h1> \n    </div> \n    \"\"\"\n      \n# display the front end aspect\nst.markdown(html_temp, unsafe_allow_html = True) \n\n      \n    \n    \n    \nid=st.number_input('enter id')\ntitle=st.text_input('Enter title')\ntext=st.text_input('Enter text')\n\n\n\npred=preprocess(id,title,text)\n\n\n\n\nif st.button(\"Predict\"):    \n  if pred[1] == 'clickbait':\n    st.error('Warning! Clickbait')\n    \n  else:\n    st.success('News!')\n    \n   \n\n\n\nst.sidebar.subheader(\"About App\")\nst.sidebar.info(\"This web app is helps you to find out whether you are at a risk of developing a heart disease.\")\nst.sidebar.info(\"Enter the required fields and click on the 'Predict' button to check whether you have a healthy heart\")\nst.sidebar.info(\"Don't forget to rate this app\")\n\n\n\nfeedback = st.sidebar.slider('How much would you rate this app?',min_value=0,max_value=5,step=1)\n\nif feedback:\n  st.header(\"Thank you for rating the app!\")\n  st.info(\"Caution: This is just a prediction and not doctoral advice. Kindly see a doctor if you feel the symptoms persist.\") \n\n\n     \nWriting Clickbait-app.py\n\n\n!nohup streamlit run clickbait-app.py &\nurl = ngrok.connect(port='8501')\nurl\n","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:20:43.324541Z","iopub.execute_input":"2022-11-12T16:20:43.324962Z","iopub.status.idle":"2022-11-12T16:20:43.333125Z","shell.execute_reply.started":"2022-11-12T16:20:43.324931Z","shell.execute_reply":"2022-11-12T16:20:43.33187Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:21:29.209393Z","iopub.execute_input":"2022-11-12T16:21:29.210072Z","iopub.status.idle":"2022-11-12T16:21:29.530893Z","shell.execute_reply.started":"2022-11-12T16:21:29.210019Z","shell.execute_reply":"2022-11-12T16:21:29.528883Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission=pd.DataFrame({'id':test.id,'label':lst})\nsubmission=submission.to_csv('submission.csv',index=False)","metadata":{"execution":{"iopub.status.busy":"2022-11-12T16:20:01.913886Z","iopub.execute_input":"2022-11-12T16:20:01.914533Z","iopub.status.idle":"2022-11-12T16:20:01.952164Z","shell.execute_reply.started":"2022-11-12T16:20:01.914485Z","shell.execute_reply":"2022-11-12T16:20:01.950709Z"},"trusted":true},"execution_count":null,"outputs":[]}]}