Let’s discuss about SVM algorithm..

SVM algorithm.

Support Vector Machine or SVM is one of the most popular Supervised Learning algorithms, which is used for Classification as well as Regression problems. However, primarily, it is used for Classification problems in Machine Learning.

The main goal of SVMs is to divide the datasets into number of classes in order to find a maximum marginal hyperplane (MMH). And SVMs will generate hyperplanes iteratively that separates the classes in the best way. After that it will choose the hyperplane that segregate the classes correctly.

And the optimal hyperplane is the one which has the biggest…

Let’s talk about the some Python packages to detect language of the text.

Language detection is one of the activity in the natural language processing, We have many python packages to serve this.

In this article we will discuss about the langid, langdetect, TextBlob.

1. langid

langid package is pre-trained over a large number of languages (currently 97).

langid package is requires >= Python 2.7 and numpy. The main script langid/langid.py is cross-compatible with both Python2 and Python3, but the accompanying training tools are still Python2-only.

langid.py is WSGI-compliant. langid.py will use fapws3 as a web server if available, and…

Let’s discusses about the different ways to replace the substring with another text content

I don’t want to waste your time by discussing about What is string, Unicode characters of string. One important to note here is that all the string methods always return new values and do not change or manipulate the original string.

Replace multiple values with different substrings.

text = "Lung cancer or bronchogenic carcinoma refers to tumor originating in the lung parenchyma or within bronchi."char_to_replace = {'Lung': 'kidney', 'tumor': 'tumors', 'bronchogenic carcinoma': ''}def string_replace_fuc(text, char_to_replace):
"""Iterate over all key-value pairs in…

Gradio allows us to quickly create customizable UI components for Python functions. And this Gradio library is free and open-source!

Let’s try Gradio with simple python code.

Creating a Python function to get spaces count in String

We can install Gradio via pip. Below code can be used for installation:

pip install gradio

The below code can be used for importing the library:

import gradio as gr

To quickly give you an idea of how this library works, let’s run the below code as a python script

import gradio as gr
def chech_space(input_string):
""" to get spaces count"""
space_count = 0
for i in input_string:
if (i.isspace()): …

Kartheek Sunkara

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store