Skip to content

Instantly share code, notes, and snippets.

Avatar

Selva Prabhakaran selva86

View GitHub Profile
View update_ner_model_challenge.py
TRAIN_DATA = [("Pizza is a common fast food.", {"entities": [(0, 5, "FOOD")]}),
("We ate dosa yesterday.", {"entities": [(7, 11, "FOOD")]}),
("Pasta is an italian recipe", {"entities": [(0, 5, "FOOD")]}),
("China's noodles are very famous", {"entities": [(8,15, "FOOD")]}),
("Shrimps are famous in China too", {"entities": [(0,7, "FOOD")]}),
("Lasagna is another classic of Italy", {"entities": [(0,7, "FOOD")]}),
("Unagi is a famous seafood of Japan", {"entities": [(0,5, "FOOD")]}),
("Tempura , Soba are other famous dishes of Japan", {"entities": [(0,7, "FOOD")]}),
("Udon is a healthy type of noodles", {"entities": [(0,4, "ORG")]}),
("Chocolate soufflé is extremely famous french cuisine", {"entities": [(0,17, "FOOD")]}),
View custom_ner_challenge.py
TRAIN_DATA =[ ("Pizza is a common fast food.", {"entities": [(0, 5, "FOOD")]}),
("Pasta is an italian recipe", {"entities": [(0, 5, "FOOD")]}),
("China's noodles are very famous", {"entities": [(8,14, "FOOD")]}),
("Shrimps are famous in China too", {"entities": [(0,7, "FOOD")]}),
("Lasagna is another classic of Italy", {"entities": [(0,7, "FOOD")]}),
("Sushi is extemely famous and expensive Japanese dish", {"entities": [(0,5, "FOOD")]}),
("Unagi is a famous seafood of Japan", {"entities": [(0,5, "FOOD")]}),
("Tempura , Soba are other famous dishes of Japan", {"entities": [(0,7, "FOOD")]}),
("Udon is a healthy type of noodles", {"entities": [(0,4, "ORG")]}),
("Chocolate soufflé is extremely famous french cuisine", {"entities": [(0,17, "FOOD")]}),
View custom_ner_challenge.R
TRAIN_DATA =[ ("Pizza is a common fast food.", {"entities": [(0, 5, "FOOD")]}),
("Pasta is an italian recipe", {"entities": [(0, 5, "FOOD")]}),
("China's noodles are very famous", {"entities": [(8,14, "FOOD")]}),
("Shrimps are famous in China too", {"entities": [(0,7, "FOOD")]}),
("Lasagna is another classic of Italy", {"entities": [(0,7, "FOOD")]}),
("Sushi is extemely famous and expensive Japanese dish", {"entities": [(0,5, "FOOD")]}),
("Unagi is a famous seafood of Japan", {"entities": [(0,5, "FOOD")]}),
("Tempura , Soba are other famous dishes of Japan", {"entities": [(0,7, "FOOD")]}),
("Udon is a healthy type of noodles", {"entities": [(0,4, "ORG")]}),
("Chocolate soufflé is extremely famous french cuisine", {"entities": [(0,17, "FOOD")]}),
View custom_component_challenge.py
text = """Ted Kaczynski (better known as the Unabomber) received an invitation in 2012,
while incarcerated in the California, to his Harvard graduating class's 50th anniversary reunion.
He RSVPed, noting his occupation as 'prisoner' and his eight life sentences as 'awards in his college'
"""
View pharsematcher_challenge.py
"""From 8 am , Mr.X will be speaking on your favorite channel 191.1. Afterward there shall be an exclusive interview with actor Vijay on channel 194.1 . Hope you are having a great day. Call us on 666666"""
View token_matcher.py
# Input text
engg_text = """If you study aeronautical engineering, you could specialize in aerodynamics, aeroelasticity,
composites analysis, avionics, propulsion and structures and materials. If you choose to study chemical engineering, you may like to specialize in chemical reaction engineering, plant design, process engineering, process design or transport phenomena. Civil engineering is the professional practice of designing and developing infrastructure projects. This can be on a huge scale, such as the development of nationwide transport systems or water supply networks, or on a smaller scale, such as the development of single roads or buildings.
specializations of civil engineering include structural engineering, architectural engineering, transportation engineering, geotechnical engineering, environmental engineering and hydraulic engineering. Computer engineering concerns the design and prototyping of computing hardware and software.
This subject merges electrical engineering with computer science,
View POS_Challenge.py
"""The little prince, I know it’s a children’s book but it addresses themes of loneliness, human nature and love. I think it’s very profound in a simplistic way. A reminder to always stay curious, creative and open."""
View ner_challenge.py
# Creating a doc on news articles
confidential_text="""Indian man has allegedly duped nearly 50 businessmen in the UAE of USD 1.6 million and fled the country in the most unlikely way -- on a repatriation flight to Hyderabad, according to a media report on Saturday.Yogesh Ashok Yariava, the prime accused in the fraud, flew from Abu Dhabi to Hyderabad on a Vande Bharat repatriation flight on May 11 with around 170 evacuees, the Gulf News reported.Yariava, the 36-year-old owner of the fraudulent Royal Luck Foodstuff Trading, made bulk purchases worth 6 million dirhams (USD 1.6 million) against post-dated cheques from unsuspecting traders before fleeing to India, the daily said.
The bought goods included facemasks, hand sanitisers, medical gloves (worth nearly 5,00,000 dirhams), rice and nuts (3,93,000 dirhams), tuna, pistachios and saffron (3,00,725 dirhams), French fries and mozzarella cheese (2,29,000 dirhams), frozen Indian beef (2,07,000 dirhams) and halwa and tahina (52,812 dirhams).
The list of items and
View challenge_measures_of_goodness_of_fit.R
# Which amongst the following models is better in terms of:
# R-Squared, Adj R-Squared, AIC and BIC
model1 <- lm(mpg ~ wt + hp, data=mtcars)
model2 <- lm(mpg ~ wt + cyl, data=mtcars)
model3 <- lm(mpg ~ qsec + hp, data=mtcars)
@selva86
selva86 / ks_plot.R
Last active Jul 7, 2020
Function to create KS Plot using InformationValue R package
View ks_plot.R
require(ggplot2)
ks_table <- InformationValue:::ks_table
ks_plot <- function (actuals, predictedScores) {
rank <- 0:10
ks_table_out <- ks_table(actuals = actuals, predictedScores = predictedScores)
perc_events <- c(0, ks_table_out$cum_perc_responders) * 100
perc_nonevents <- c(0, ks_table_out$cum_perc_non_responders) * 100
random_prediction <- seq(0, 100, 10)
You can’t perform that action at this time.