[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-515349-105":59,"doc-detail-515349-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","omauthornlp","OmAuthorNLP","","Notebook-style NLP workflow for author identification. It installs and reloads deep learning modules, imports FastAI, TorchText, and related language modeling utilities, and loads an English tokenizer. It sets a data path, lists dataset files for training and testing, and consolidates each CSV’s text column into space-separated plain text files. The process prepares trainData.txt and testData.txt outputs intended for subsequent modeling with language processing tools and tokenization.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/omauthornlp/515349/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/omauthornlp/515349.png","ImageObject",300,407,{"name":92,"@type":93},"BAd apple","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-16","2026-10-06",true,{"@type":102,"interactionType":103,"userInteractionCount":34},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is the main goal of the workflow?","Question",{"text":112,"@type":113},"Prepare text corpora from training and testing CSV files to support an NLP author identification task.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How are train and test texts created from CSV files?",{"text":117,"@type":113},"Each row’s 'text' field is concatenated into a single space-separated string, then written to trainData.txt and testData.txt.",{"name":119,"@type":110,"acceptedAnswer":120},"Which datasets and files does the code reference?",{"text":121,"@type":113},"It points to a local directory containing train.csv, test.csv, and generates corresponding trainData.txt and testData.txt files.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},515349,1791518913,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":34,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":144,"read_time":145,"preview_page_count":26,"preview_urls":146},19241458193282,"https://us-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","In [1]:  \n%reload ext autoreload  \n%autoreload 2  \n%matplotlib inline  \nfrom fastai .learner import *  \nimport torchtext  \nfrom torchtext import vocab , data  \nfrom torchtext.datasets import language_modeling  \nfrom fastai.rnn_reg import * from fastai .rnn_train import * from fastai .nlp import *  \nfrom fastai .lm_rnn import *  \nimport dill as pickle  \nimport pandas as pd  \nimport numpy as np  \nWarning: no model found for 'en'Only loading the 'en' tokenizer .  \nIn [2]:  \nPATH= 'data/spooky-author-identification/'  \n%ls {PATH}  \nmodels/ sample_submission .csv [sample_submission.zip](sample_submission.zip)  \ntest .csv  \ntestData .txt  \n[test.zip](test.zip)  \n[tmp](tmp/ train.zip)[/](tmp/ train.zip)[ train.zip](tmp/ train.zip)  \ntrain .csv  \ntrainData .txt  \nIn [3]:  \ndef save_data (df , file_train):  \ntrainData = \"\"  \nfor idx , row in df .iterrows():  \ndata = row [ 'text' ]  \nif trainData == \"\" :  \ntrainData= data  \nelse :  \ntrainData=trainData + \" \" + data  \nfile_train .write (trainData)  \nfile_train .close()  \nreturn trainData  \nIn [4]:  \nfile_train= open ( f ' {PATH}trainData.txt' , 'w' )  \nIn [5]:  \n[df_train = pd.read_csv](df_train = pd.read_csv)(f'{PATH}train.csv')  \nIn [6]:  \ntrain_data= save_data (df_train , file_train)  \nIn [18]:  \n[df_test = pd.read_csv](df_test = pd.read_csv)(f'{PATH}test.csv')  \nIn [19]:  \nfile_test= open ( f ' {PATH}testData.txt' , 'w' )  \nIn [20]:  \ntest_data= save_data (df_test , file_test)  \nIn [21]:  \n' ' .join ( spacy_tok (train_data))  \nOut[21]:  \n'This process , however , afforded me no means of ascertaining the dimensions of my dungeon ; as I might make its circuit , and return to the point whence I set out , without being aware of the fact ; so perfectly uniform seemed the wall . It never once occurred to me that the fumbling might be a mere mistake . In his left hand was a gold snuff box , from which , as he capered down the hill , cutting all manner of fantastic steps , he took snuff incessantly with an air of the greatest possible self satisfaction . How lovely is spring As we looked from Windsor Terrace on the sixteen fertile counties spread beneath , speckled by happy cottages and wealthier towns , all looked as in former years , heart cheering and fair . Finding nothing else, not even gold , the Superintendent abandoned his attempts ; but a perplexed look occasionally steals over his countenance as he sits thinking at his desk . A youth passed in solitude , my best years spent under your gentle and feminine fosterage , has so refined the groundwork of my character that I can not overcome an intense distaste to the usual brutality exercised on board ship : I have never believed it to be necessary , and when I heard of a mariner equally noted for his kindliness of heart and the respect and obedience paid to him by his crew , I felt myself peculiarly fortunate in being able to secure his services . The astronomer , perhaps , at this point , took refuge in the suggestion of non luminosity ; and here analogy was suddenly let fall . The surcingle hung in ribands from my body . I k  \nnew that you could not say to yourself \\' stereotomy \\' without bein  \ng brought to think of atomies , and thus of the theories of Epicurus; and since , when we discussed this subject not very long ago , I mentioned to you how singularly , yet with how little notice , the vague guesses of that noble Greek had met with confirmation in the late nebular cosmogony , I felt that you could not avoid casting your eyes upward to the great nebula in Orion , and I certainly expected that you would do so . I confess that neither the structure of languages , nor the code of governments , nor the politics of various states possessed attractions for me . He shall find that I can feel my injuries ; he shall learn to dread my revenge \" A few days after he arrived . Here we barricaded ourselves , and , for the present were secure . Herbert West needed fresh bodies because his life work was the reanimation of the dead . The farm ","cbCaipDSgQ0YlHRC","https://ap.wps.com/l/cbCaipDSgQ0YlHRC","pdf",2879242,874,"English","# Data path and dataset listing\n# Build train text corpus\n# Build test text corpus\n# Tokenize training text","[{\"question\":\"What is the main goal of the workflow?\",\"answer\":\"Prepare text corpora from training and testing CSV files to support an NLP author identification task.\"},{\"question\":\"How are train and test texts created from CSV files?\",\"answer\":\"Each row’s 'text' field is concatenated into a single space-separated string, then written to trainData.txt and testData.txt.\"},{\"question\":\"Which datasets and files does the code reference?\",\"answer\":\"It points to a local directory containing train.csv, test.csv, and generates corresponding trainData.txt and testData.txt files.\"}]","OmAuthorNLP | PDF",1791312563,2202,[147,151,155,159,163,167,171,175,179,183,187,192,197,202,207,212,217,222,227,231,235,240,245,250,255,260,265,270,275,280,284,289,294,299,304,309,314,319,324,329,333,338,343,348,353,358,363,368,373,378,382,387,392,397,402,407,412,417,422,427],{"page_no":8,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/50b8bca607f0b88a6c608d1257b37b9c.webp",983,1251,{"page_no":14,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/37bd6a2a5ed8e9fccd9afbf3b213f33b.webp",982,1250,{"page_no":81,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/ed11d5ca57c7e2d5c0bc36d881eadfe1.webp",981,1249,{"page_no":19,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/96b840cbbf7bbc4e16ff4f3bc93b89c7.webp",980,1248,{"page_no":24,"url":164,"width":165,"height":166},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/3741fc1ecf078793d28ec49f7b383d0f.webp",979,1246,{"page_no":29,"url":168,"width":169,"height":170},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/48dd17bfcb1adfae89974944bf678102.webp",978,1245,{"page_no":34,"url":172,"width":173,"height":174},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/e41e2f162b28bffaceb71bfbe551e184.webp",977,1244,{"page_no":39,"url":176,"width":177,"height":178},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/e21e107a771dcfb8fe8012c681321e0d.webp",976,1242,{"page_no":44,"url":180,"width":181,"height":182},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/edaaf5e0f80f0139d4b18855540b2bee.webp",975,1241,{"page_no":52,"url":184,"width":185,"height":186},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/424d5bc029c7348deff22b52ab5aabc1.webp",974,1240,{"page_no":188,"url":189,"width":190,"height":191},11,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/4f94d3e945ded361a12286c214a81787.webp",973,1239,{"page_no":193,"url":194,"width":195,"height":196},12,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/6e56473c9727f039ccee9eb555a980ae.webp",972,1237,{"page_no":198,"url":199,"width":200,"height":201},13,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/07d1735f3a8a8dd2fe05e6c3445d6825.webp",971,1236,{"page_no":203,"url":204,"width":205,"height":206},14,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/9d8e5f2b74d97b2b4ffd6911b6578545.webp",970,1235,{"page_no":208,"url":209,"width":210,"height":211},15,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/8a501625015355e6c1a7bf0f141deba9.webp",969,1234,{"page_no":213,"url":214,"width":215,"height":216},16,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/ee6ce20f706ea945c9e5bfd633fa75d5.webp",968,1232,{"page_no":218,"url":219,"width":220,"height":221},17,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/2bb239fc22c8b8e01425a3380d6e756b.webp",967,1231,{"page_no":223,"url":224,"width":225,"height":226},18,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/b5a192f317999367d57250b8f1c20436.webp",966,1230,{"page_no":56,"url":228,"width":229,"height":230},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/508811b9ac16e0cb482a638a996a5fd9.webp",965,1228,{"page_no":46,"url":232,"width":233,"height":234},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/5fd949cc46936dc99d716882f3524b49.webp",964,1227,{"page_no":236,"url":237,"width":238,"height":239},21,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/b19b6422c290ba8a3dfb5a1cd561e8f9.webp",963,1226,{"page_no":241,"url":242,"width":243,"height":244},22,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/9e9b019d64d196ff8f9b71bd4adbc662.webp",962,1225,{"page_no":246,"url":247,"width":248,"height":249},23,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/8189a3f98bacef7e52fb3df380ea476b.webp",961,1223,{"page_no":251,"url":252,"width":253,"height":254},24,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/8f594788b2089686982805656ad43cd5.webp",960,1222,{"page_no":256,"url":257,"width":258,"height":259},25,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/60d3c3f1adc61f62beae1b00e85dfca7.webp",959,1221,{"page_no":261,"url":262,"width":263,"height":264},26,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/7c47de5136b45ac49cf586869ef932e8.webp",958,1220,{"page_no":266,"url":267,"width":268,"height":269},27,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/a754d54a81097a8254a8c459ba977152.webp",957,1218,{"page_no":271,"url":272,"width":273,"height":274},28,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/c9dcc41ca4cd6cd340ce858e00a14402.webp",956,1217,{"page_no":276,"url":277,"width":278,"height":279},29,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/0f667995fb17fb7d0160898d54e02585.webp",955,1216,{"page_no":41,"url":281,"width":282,"height":283},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/aaf311a791f71ca534537efa8ec67e3a.webp",954,1214,{"page_no":285,"url":286,"width":287,"height":288},31,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/87935dd51d224048cd34335e19b6f043.webp",953,1213,{"page_no":290,"url":291,"width":292,"height":293},32,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/2ecf1d4061b6a64761d8ec2fe41ef62c.webp",952,1212,{"page_no":295,"url":296,"width":297,"height":298},33,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/274edd701b5cdf492850c19fc5f4d7d8.webp",951,1211,{"page_no":300,"url":301,"width":302,"height":303},34,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/addd86a31172e1445b86a9b41510ac7b.webp",950,1209,{"page_no":305,"url":306,"width":307,"height":308},35,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/9d794f08792d0bdb8fda23f31c9fa7a2.webp",949,1208,{"page_no":310,"url":311,"width":312,"height":313},36,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/8feba116f5a79f67063a4895bc550bc0.webp",948,1207,{"page_no":315,"url":316,"width":317,"height":318},37,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/331d6f0d5594d4662784178e71561208.webp",947,1206,{"page_no":320,"url":321,"width":322,"height":323},38,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/bb8984c056c2f5b8caa5c588ec0d6401.webp",946,1204,{"page_no":325,"url":326,"width":327,"height":328},39,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/fc0d870c63ed7f51447037a291745783.webp",945,1203,{"page_no":36,"url":330,"width":331,"height":332},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/2d06a96bef8c66cf8803ec8de06e8846.webp",944,1202,{"page_no":334,"url":335,"width":336,"height":337},41,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/d16bac10b47f77330b86c0c49088ec85.webp",943,1200,{"page_no":339,"url":340,"width":341,"height":342},42,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/7d071ae8d54f2354e2f9cab20aca2939.webp",942,1199,{"page_no":344,"url":345,"width":346,"height":347},43,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/9875d7e79f8fd24bd4db815f28bfb572.webp",941,1198,{"page_no":349,"url":350,"width":351,"height":352},44,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/0be3235b4c30f8dfe9ed88ade9d5b1c2.webp",940,1197,{"page_no":354,"url":355,"width":356,"height":357},45,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/1773a98c4e2b13605f423f872e3e2766.webp",939,1195,{"page_no":359,"url":360,"width":361,"height":362},46,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/41d384c20fafab93c898c783d877a762.webp",938,1194,{"page_no":364,"url":365,"width":366,"height":367},47,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/1a98ae8e956762b23e6daa3fb2760fce.webp",937,1193,{"page_no":369,"url":370,"width":371,"height":372},48,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/91fdea4e4d9dc9bd9115bb6a20b12e71.webp",936,1192,{"page_no":374,"url":375,"width":376,"height":377},49,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/5a120c71cdbc77e315cf1345c51a6ad1.webp",935,1190,{"page_no":31,"url":379,"width":380,"height":381},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/47520e29d14d33e8ed7ea8afa0b45bcf.webp",934,1189,{"page_no":383,"url":384,"width":385,"height":386},51,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/b0e63df2abd4af7407e0a155425406ad.webp",933,1188,{"page_no":388,"url":389,"width":390,"height":391},52,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/c17ce99c1126803972396b7741af5cc9.webp",932,1186,{"page_no":393,"url":394,"width":395,"height":396},53,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/1e7d04eefe54b48567c5631c2d9747f7.webp",931,1185,{"page_no":398,"url":399,"width":400,"height":401},54,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/182a42487f95d5fb013b28666d24df4a.webp",930,1184,{"page_no":403,"url":404,"width":405,"height":406},55,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/2ed66e2af4ebc8b95232605d49c1b3b7.webp",929,1183,{"page_no":408,"url":409,"width":410,"height":411},56,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/409c45e09a340d9748323e75275c0315.webp",928,1181,{"page_no":413,"url":414,"width":415,"height":416},57,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/0da548893321713b4ee380ddc13f2f9a.webp",927,1180,{"page_no":418,"url":419,"width":420,"height":421},58,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/1e4a1d97542747941395c5809a7de37a.webp",926,1179,{"page_no":423,"url":424,"width":425,"height":426},59,"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/2de1e3b8a2c7ccb76e7a48318b6f8235.webp",925,1178,{"page_no":26,"url":428,"width":429,"height":430},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/2cc2b487f26da8b13e22ef1991f1ebde.webp",924,1176]