2. Write R and python code to replace “bcz” with “because” in whole text? Answer: R code: In R Sub() function can be used to find the text and with help of gsub(), text can be replaced: test <- "asdas bcz asdsd" gsub("bcz", "because", test) Python Code: In Python same can be achieved by using string.replace() function. our_str = 'Bcz I am there' import string new_str = string.replace(our_str, 'Bcz', 'Because') print(new_str)
3. How do you deal with the English text having Hindi words in between? Answer: There are two ways to treat hindi text between English words: Translate the Hindi Words to English: Lookup all the words in English dictionary and tag them as such Remove the Hindi Words: Using the words corpus from NLTK 4. Write R code to connect with this public API - ? Answer: Create a account on to get the api key Library(httr) Query <- Out<- GET(url=Query) 5. What are the different methods to deploy a model into production system? Answer: Before deploying any models into productions, we should consider following points: 1. What are my requirements? (i.e. how many requests are you expecting per second, what latency is required…etc) 2. How will I evaluate the model’s performance in production? (and how will I collect and store the additional data from interactions) 3. How frequently do I plan on re-training my model? 4. What are the data pre-processing needs? 5. Will the format of the production input data differ drastically from the model training data? Will it come in batches or as a stream? 6. Does the model need to be able to run offline? Broadly the methods can be categorized into two: 1. Online deployment models: Data mining tools like Revo Deploy R or Orange or using Web-framework 2. Offline deployment Modes: a. Programming language like Java,C, VB b. Database and SQL scripts c. Predictive model markup language d. Schedulers
You've reached the end of your free preview.
Want to read both pages?
- Fall '19