Category Archives: Healthcare Application Development

Sentiment Analysis

Sentiment Analysis in Healthcare

Introduction:

Sentiment Analysis refers to analyzing text data and assigning some kind of sentiment to it. For e.g., we see a movie review on the IMDB website such as – “It was a good movie”. We can understand that the viewer liked the movie and we can go on to say that this review can be assigned a positive sentiment. Similarly, If the review was “It was a bad movie”, we can consider this as negative feedback for the movie and say that it generates a negative sentiment. So how do we go about creating a model that takes in a review/ statement as input and gives out the corresponding sentiment ?

One way to go about it is to create a dictionary of all words that correspond to positive feedback, and another of all words that provide negative feedback. Run a search through the statement and see which words are present. This is a very very simple example of how Sentiment analysis can be done. More on this later, but why would we need a Sentiment Analysis model?

Most companies provide their customers a platform, which could be social media or a company website, to express their feelings about a product or service so that the company can then use this data to improve the quality of their product / services. Since people can post feedback at ease with just their mobile phones, this generates a huge amount of data. Going through all data manually is a labor-intensive process. Hence, sentiment analysis has become an important tool for companies to track and monitor their online feedback and brand value. This is just one example; there are other areas as well where one can use a tool such as sentiment analysis. Let’s look at how it can help to solve some challenges in the Healthcare Industry.

Defining our Input to the model:

Before we discuss the details of the model, we need to find a way to represent sentences for a model to understand. The first approach is bag of words. The way this approach works is we first create a vocabulary of all words we have in our training data. This vocabulary then forms our feature space, or our X’s for the training. Given the number of words in the English language, we could have 10000 words in our vocabulary. We will get to reduce our feature space later.

So now that we have our X’s, we define a way to represent a sentence. We can do so by assigning the count of each word to our feature space. Coming back to our previous example, “It was a good movie”, we will have the following counts or word frequencies- It:1 , was: 1, a: 1, good:1, movie:1. The values for all other words will be 0. Each word will have a fixed position on our feature space, so for all other words, if we substitute zero then we have 0, 0,0,…,1,0,,…1,0…0. Note we have counts only at the position of the words in our current example. This type of encoding is also called one hot encoding.

We can limit the number of words our vocabulary has by using a few tricks, for instance removing words like a, the, this, is, etc. These words do not generally add any meaning to our sentences. These are stop words. Next, to further limit our vocabulary, we can keep only those words that have a frequency above a certain threshold. Doing this, we can reduce our vocabulary to 1/10th of our initial size. Now coming to encoding our target variable. Since this is a good review, we have 1 as our target variable. Note that we are only trying to classify good or bad reviews and having a 1 for good and 0 for bad is sufficient for training our model. All of these can be achieved by a few lines of code using python’s NLTK (Natural Language ToolKit) library and python’s Scikit-learn library.

Defining our model:

Machine learning can broadly be categorized into two parts, supervised and unsupervised learning. Supervised learning is one where we give both input and targets as training data. This is generally used for classification or regression tasks. Unsupervised learning contains just input data, no output is associated with it, and this is used for clustering problems, where the algorithm tries to group the input data into clusters. Since this is a classification problem, we will be classifying the review into one of the good or bad classes, we will rely on either Logistic regression or Random Forest classifier.

We will go into the details of logistic regression or Random Forest in a different article. But for the purpose of this venture, we will pass a python list (arrays) to the model. This is the input list that we get using one hot encoding as defined above, and get a one or zero as an output. Let’s assume the model we build has around 80% chance for classifying a given review accurately. This may not necessarily be difficult to achieve for a task such as this. All of these can be achieved fairly easily using python’s Scikit Learn library.

Problems faced by the service Industry and Solution with Sentiment Analysis:

An insurance company wants to find out whether imparting behavioral training to their service staff has an impact on the overall feedback they receive as reviews.

We start by defining a metric for valuation. Let our performance indicator be the number of positive reviews/ total number of reviews. Assuming there are at least 30 reviews for each staff under consideration. We get the reviews for all staff before and after behavioral training has been imparted. Put them through our model and generate positive and negative outcomes for these reviews. Then do a comparison of percentage positive and negative reviews before and after the training. This will establish a correlation between training and change in reviews. To establish causation, we also need to create treatment and control groups. The treatment group will have the staff that receives the training and control will be the staff that doesn’t. Comparing the change between treatment and control groups will tell us whether the training has an impact.

Like other businesses, if you too are looking for solutions in Sentiment Analysis, Mindfire Solutions can be your partner of choice. We have deep expertise in AI and ML Capabilities. With a team of highly skilled and certified software professionals, that have developed many custom solutions for our global clients over the years.

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
AI in Healthcare

AI in Healthcare Insurance

AI has transformed industries and has immense potential to reshape the healthcare landscape. Medical data like patient visits, prescriptions contain valuable information which can be extracted to create a more structured data format. This has become possible with Artificial Intelligence and Machine Learning. This in turn offers insights into the trends and facilitates collaboration between different healthcare units. AI applications range from early detection of symptoms to potential diagnosis at a fraction of the cost and increased accuracy.

What is Optical Character Recognition?

Artificial intelligence refers to the use of Machine Learning algorithms to mimic human behavior. Say we want to create a program that takes an input and gives an output. The program uses some decision-making mechanism to arrive at an output. This is primitively done by something called IF-ELSE statements. The limitation of these statements is that one needs to know the exact condition that will produce the desired output. For example, we know the marks of a student and we want to assign a grade, we can hardcode the same using if-else statements – IF marks > 90 then grade = ‘A’. In this case, we have a clearly defined boundary that helps us arrive at our output. But what happens when we don’t have a clearly defined boundary?

Let me explain this with an example. Suppose we have an image of a letter. And we want our program to tell us which letter it is. What kind of code shall we write? This is an example of a problem that doesn’t have a clearly defined boundary. One way to solve this problem is to build a model, which does not use if-else statements but works quite differently. The idea is to feed the program an input image (say an image of ‘A’) and tell the program that it’s an ‘A’. We do this repetitively and try to get the program to learn what ‘A’ looks like. Hence, the term “Machine Learning”. We do the same for every letter or number. This falls under the computer vision category, namely Optical Character Recognition.

Overview of Natural Language Processing :

Natural language Processing is an area of AI and Linguistics and it deals with the application of computational techniques and models to the analysis of human languages. NLP deals with processing written text including but not limited to extracting useful information such as named entities, etc. This requires an understanding of what a word means, which is not something computers generally have. This too is done by learning, where a huge amount of text is fed to the model, and it will try to learn patterns and dependencies between words. In the next section, we will define a problem statement and see how an application of these two concepts can help us make better decisions faster, way faster.

Problems faced by the Healthcare Industry :

Insurance companies have certain parameters to account for when finalizing the premiums they charge for their insurance. One of the most important parameters is the medical history of the member/ insurance holder. The idea is that if a member has more cases of medical history then that member is more likely to raise a claim in the future, thereby costing more.

So the insurance companies need to know relevant details of the medical history and assign risk scores (this could be a topic for another article) corresponding to the medical history. But medical histories are generally stored in paper form. Suppose you had a doctor’s visit, everything there is generally stored in paper format. One might have had any number of tests, and these are in most cases available in paper form. Thus, going through all the paperwork of a member’s medical history is an engaging task. This might take a person anywhere between 30mins – 1 hour. So, is there a way to automate the task?

How can AI help to resolve the issue?

The first step in the process is to get the images of all our documents. The idea is to use OCR to extract the text information from images and subsequently use NLP to extract relevant information, such as diagnosis, procedure or operation, medications that the member is on, etc. There are many open-source OCR engines, one such engine is Tesseract OCR.

Tesseract is used for text detection within large documents or used in concurrence with an external text detector. It can be used directly or through an API to extract text from images. It supports Unicode and has the ability to discern more than 100 languages and can also be trained to recognize multiple languages. The current model, Tesseract 4 focuses on line recognition. It also supports the legacy Tesseract 3 in recognizing character patterns. It is compatible with many programming languages and frameworks. CNN (Convolutional Neural network) is typically used for single character whereas RNN is used for multi-characters.

The next step is to feed the image to the tesseract engine. It will give a file output that contains text extracted from the image. There are various Open source NLP engines. We then feed lines from the text file to our NLP engine which will read each line and use dependencies between words to figure out what our diagnosis, procedure or medications will be. Most NLP engines offer phrase matching capabilities, so we can look for particular phrases as well. We can narrow our search to a specific diagnosis (or any other information of relevance) as well.

Final Steps :

Once we have extracted output from the NLP engine, we can create a database that will have fields such as member name, document type, extracted information, etc. We can use the above pipeline and feed it numerous files at once and after every output, we can append the same to our database.

This process takes a mere few seconds to go through all the files of a member. Using this, we will be able to read through the medical history of thousands of members in a matter of hours.

Like other businesses, if you too are looking for Application development in AI, Mindfire Solutions can be your partner of choice. We have deep expertise in AI and ML Capabilities. With a team of highly skilled and certified software professionals, that have developed many custom solutions for our global clients over the years.

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Chiropractic Practice Management Software

Chiropractic Practice Management Software

David was a renowned chiropractor in the city. “Dr. Dave” they called him.

“He has magic in those hands,” they would say.

“My mother tried yoga, and exercises, and medicines – nothing worked. One appointment with Dr. Dave, and now she goes about like she’s 20!” This was just one such story.

There were a lot more that served to spread his fame. Women and men of all ages would line up from across the city for his adjustments. They would assemble even before the clinic would open. Once, to handle the volume, David hired an assistant, but people would only want David. He had to let the person go. Continue reading Chiropractic Practice Management Software

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •