7 Common Computer Problems Encountered By Users


When you are working on the computer regularly for 6 to 8 hours, facing technical issues is quite common. On finding highly complex problems that are beyond your understanding, you can ask for help from professionals. However, if the issue is not so big, you can take care of that on your own. 

When you understand the reason behind the problem, it becomes easy to resolve it, and sometimes the workaround methods take less than a

minute. So, next time you face any issue with your computer, do not rush to contact a technician; instead, try to resolve it yourself and save money.

In this article, we are explaining some common computer issues that users normally encounter when working in a stretch.

Computer Performs Slow

When you start your computer and need to wait for a few minutes before you see the logo, it’s a clear sign that your computer is running slow. Once you come to the welcome screen only to find that the apps and folders are not opening properly, the files are not immediately accessible; the browser is not working well, check for the problem behind the slowdown.

Say that you have an underperforming MacBook. While figuring out how to fix a slow mac, you may delete additional apps that you installed a year ago and not use them for quite some time now. In addition, erase duplicate images, files, and other data to remove redundancy and claim more space on the storage drive.

Unusual Sound & Overheating

A noisy laptop or desktop can be a sign of exhaustion. When it occurs, simply shut down your computer for some time and then restart it to resume functioning. It can be the fan or some hardware that might be expelling sound. The noisy sound followed by overheating indicates that there is something wrong with the device.

Overheating can be the result of multiple applications running on your computer may be in the background. Open Task Manager (Windows) or Activity Monitor (macOS) to check the heavy load processes that are consuming excessive resources and stop them right away.  

Blank Screen Issue

If all the connections are up-to-the-mark, but your computer screen appears blank, check if the power connection is not loose and that the outlet is working properly. If you are facing this issue on your laptop, there might be a battery issue; so try to disconnect and then reconnect the battery.

In addition, check if the charger is working appropriately; else, you need to replace it. If nothing seems to work, there might be a problem with any of the internal hardware components, and you might require contacting professional help.

Abrupt System Shutdown

If the computer shuts down suddenly, there may be an issue with the power supply. You need to fix it immediately, and else you may lose your unsaved data and require spending more time completing the project you are working on.

Connect another device to the power outlet to check if it’s working properly. Alternatively, connect your computer to another socket to detect if the computer is at fault. In addition, you need to check all internal and external components as the problem might be due to hardware breakdown.

Slow Functioning of Apps

Cleaning the clutter from your computer will resolve many common computer issues, including the one you are facing while launching apps. Unnecessary apps and files start accumulating on the hard drive over time and result in slowdowns.

These apps consume system resources, which often interrupts the smooth functioning of required apps and processes as sufficient resources are not available. Deleting unnecessary apps can be the only viable solution to keep the system running and maintain the optimal health of the storage device.

Freezing Screen or App

The freezing of the computer screen or apps indicates that you are running short of RAM space or having some corrupt files, spyware attacks, or there may be registry conflicts. Turn off the power button until the computer is properly off. 

Afterward, restart the computer, and clean up the garbage so that the screen will not freeze again. In addition, upgrade RAM if the budget allows. 

Typing Inaccuracy Due to Inappropriate Keys

Have you ever noticed that your keyboard is not working properly or the characters are missing when you are typing? There might be a problem with your computer keys, or there can be a dust buildup. No worries, fixing the problem is easy.

To solve a problem related to keyboard keys, you should take out the keys carefully and clean the inside part of the keyboard. Clean the keyboard with a damp cloth, or you can also use a can of compressed air and gently blow out any dirt accumulating beneath the keyboard keys.



Source link

How to Install en_core_web_lg Spacy Language model


Spacy is an advanced natural language library for text processing in python. Using it you can easily find the context of the text therefore very helpful for extracting meaningful information from the text. As the text can be of different languages and spacy is trained according to that. In this entire tutorial, you will learn how to install en_core_web_lgin your system.

What is en_core_web_lg ?

en_core_web_lg is the trained pipeline for the English language. It is optimized for the CPU and contains components like ok2vec, tagger, parser, senter, ner, attribute_ruler, lemmatizer. Its file size is 741 MB as compared to en_core_web_md whose size is only 13 MB.  It is the largest English model in size provided by Spacy.

How to install en_core_web_lg ?

There are many coders that have asked data science learner to make a complete post on how to install en_core_web_lg on their system. In this section, you will know all the steps to install en_core_web_lg.

Step 1: Install Spacy

The first step is to install spacy on your system using the pip or pip3 command depending on your python version. If your version is 2. xx then use the pip command and if it is python 3. xx then use pip3.

To check the version of your python version uses the below command.

python --version
Checking Python version before installing spacy
Checking Python version before installing spacy

For python 2. xx version

pip install -U spacy

For python 3. xx version

pip3 install -U spacy
Installing spacy in windows
Installing spacy in windows

Step 2: Install the en_core_web_lg

After installing spacy run the below command to download and install en_core_web_lg in your system.  The syntax for downloading the model is below.

python -m spacy download [model]

[model] is the name of the model you want to install.  In our case the model name is en_core_web_lg.

python -m spacy download en_core_web_lg
Downloading en_core_web_lg model
Downloading en_core_web_lg model

There is also another method to install the en_core_web_lg language model using the pip command. To do so you have to run the following command.

pip3 install https://github.com/explosion/spacy-models/releases/download/de_core_news_lg-3.2.0/de_core_news_lg-3.2.0-py3-none-any.whl

You can download more releases for other models from Github.

Conclusion

Spacy is the best package for implementing NLP tasks. You can tokenize, lemmatize , match documents using it. To do so you have to use various trained language models and  en_core_web_lg is one of them. These are steps you will follow to install en_core_web_lg on your system. I hope you have liked this tutorial on installing en_core_web_lg.

If you have any doubt then you can contact us for more help.

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.





Source link

What’s A Substitute For Pastis? The Answer!


If you have ever strolled the streets of Paris or sat in a French café at dusk, you have seen Pastis.

Pastis is a French liqueur that tastes like anise, or black licorice. It is commonly found as an afternoon aperitif in the southeast of France.

It derives its flavor from licorice and star anise- sometimes fennel- and the result is a herbaceous and aromatic spirit that you enjoy alongside a carafe of ice water, diluted.

What’s a Substitute for Pastis?

Pastis is distinctively flavored, but a good substitute is Pernod, particularly an herbal flavored Pernod made by Sazerac called Herbsaint. Since Pastis is considered to be anise liqueur and a cousin to ouzo and sambuca, these may also be good substitutes. Other licorice or anise-flavored liqueurs that may work include Anisette and Absinthe- or, you can choose a flavorless liquor like vodka and infuse it with aniseed or anise essential oil.

What's a Substitute for Pastis?
What’s a Substitute for Pastis?

Want to learn more about the best substitute for Pastis? Keep reading!

Drinking and Enjoying Pastis

There is a classic way to enjoy Pastis that makes it distinctive from other aperitifs and cocktails.

The Pastis must be diluted with water to drink or else it simply tastes strong and astringent.

Generally, you can mix one part Pastis to five or more parts of water for a refreshing ratio that makes the perfect sip.

Make sure the water is very cold and serve the Pastis with a balloon glass if you want to keep it old-school.

You can add ice to the water to retain the chill- but don’t put ice directly in your Pastis or it could cause crystallization.

Some like to serve the Pastis neat with a carafe of ice water on the side, while others serve a tall, cold glass of water with a snifter or shot glass of Pastis on the side- the choice is yours.

This allows the drinker to dilute and mix their Pastis to their desired strength, as it can taste astringent and be drying on the tongue when too strongly mixed.

When mixed with water, you may notice that the Pastis becomes cloudy and opaque.

A normal serving of Pastis contains about the same amount of alcohol as a can of beer or glass of red wine.

Pernod is a great substitute for Pastis
Pernod is a great substitute for Pastis

Suitable Substitutes for Pastis

While Pastis is a one-of-a-kind spirit, it may not be readily available everywhere. In these instances, you may need to find a suitable substitute for the aperitif.

If you consider some of the inherent features of Pastis, such as the fact that the spirit is macerated and not distilled, any anise liqueur is not going to do.

Furthermore, Pastis’ close cousin Sambucca is sweet- perhaps too sweet to be the right substitute in some preparations and applications.

Pernod is a kind of Pastis, but much more widely available and versatile.

Pernod makes a good substitute for Pastis when it comes to sipping or in a variety of dishes and recipes.

Both taste like black licorice with a distinctive anise aroma.

Absinthe can be used as a Pastis substitute
Absinthe can be used as a Pastis substitute

Serve Pernod neat with ice water on the side, but do not drink it neat. It is intensely flavored and should be diluted to taste by the person enjoying it.

Some mixologists recommend one part Pastis to five parts of water until your taste buds acclimate to the flavor.

As for cooking, you can substitute Pernod for Pastis in many dishes, but most particularly in the region’s famous Bouillabaisse fish stew.

Pastis is much more intense and stronger flavored than Pernod, so you may need to use a bit more Pernod when using it as a substitution.

Frequently Asked Questions About What’s a Substitute for Pastis

Where to find Pastis?

Pastis is traditionally found in France, particularly the Marseille region where shoppers will find over 75 different types of pastis and licorice-flavored liqueurs. It can also be ordered online for delivery to the buyer’s door in many regions.

How to make Pastis?

You can make your own variation on Pastis by infusing vodka or gin with select seeds and herbs. Seal the jar and stir it from time to time, keeping it in a cool, dark place for about a month. Choose additives like star anise, fennel seed, and aniseed, and add a bit of sugar to taste. When it is ready, strain it to remove the seeds and herbs before serving.

What can you cook with Pastis?

Pastis can be used in cooking, and it adds an interesting, herbaceous flavor to many foods. Many fish and seafood dishes get unique flavor from Pastis, as do some chicken and egg dishes. In fact, Pastis is a star ingredient in Bouillabaisse fish stew. If you do not have Pastis for your stew, many cooks substitute with Pernod.

How to enjoy Pastis?

Enjoy Pastis neat with a sidecar of very cold, ice water. Dilute the pastis to taste but never drink it neat as it is strong and may be bitter. Pastis makes the perfect aperitif to sip while people watching or enjoying a sunset.

What does Pastis mean?

The word “pastis” translates to “mash-up” in the South of France’s Occitan dialect.
Feeling like a getaway to the south of France? Even if you can’t go, you can get that same feeling by sipping a glass of Pastis outside in the sun. Pastis has a very unique flavor that can best be described as anise and licorice- like. For this reason, Pernod makes a suitable substitute in most applications and situations.



Source link

[Solved] Error: Cannot find module ‘node:events’


If you are trying to use the Discord.js to develop any custom application and if you are not using latest version of Node.js you will get an Error: Cannot find module ‘node:events’

In this tutorial, we will look at what is Error: Cannot find module ‘node:events’ and how to fix the issue with an example.

What is Error: Cannot find module ‘node:events’?

Discor.JS is mainly used to create the custom bots in Discord. Discord.js is a powerful Node.js  module that allows you to easily interact with the Discord API .

We can install the Discord.js using the npm/yarn as shown below

npm install discord.js
yarn add discord.js
pnpm add discord.js

Once installed, let’s say we create a simple bot using discord.js

const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('interactionCreate', async interaction => {
  if (!interaction.isCommand()) return;

  if (interaction.commandName === 'ping') {
    await interaction.reply('Pong!');
  }
});

client.login('token');

Output

internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'node:events'

When we run the code it will fail and we will get an Error: Cannot find module ‘node:events’

How to fix Error: Cannot find module ‘node:events’ ?

The discord.js is a node module and it is developed using the latest version of node.js. So if you have the older version of the node.js and try to build a discord bot you will get this error.

We can fix the Error: Cannot find module ‘node:events’ by upgrading the node.js to version 16.6.0 or above.

We can upgrade the node.js to latest version by running the below command on windows.

npm cache clean
npm update -g

For installing specific version or if you want to upgrade node.js in other environments such as linux checkout How to upgrade Node.js in different environments

Conclusion

The Error: Cannot find module ‘node:events’ occurs if you are not using the latest version of node.js 16.6.0 or above and developing the discord bots.

We can fix the issue by upgrading the Node.js to 16.6.0 version or above using the npm update -g command and running the application again.



Source link

What Is The Best Way To Filter Turkish Coffee? #1 Best Secret


Turkish coffee is a unique and delicious beverage that has been enjoyed by people all over the world for centuries.

Turkish coffee has a uniquely different taste that sets it apart from others and most of that is due to the grounds left in the pot.

In this blog post, we will teach you how to filter Turkish coffee like a pro to get rid of those grounds so you can enjoy your cup of joe.

What’s the Best Way to Filter Turkish Coffee?

The best way to filter Turkish coffee is to take a paper filter and put it over the mug you wish to pour your Turkish coffee into and then slowly pour your brewed Turkish coffee through the paper filter into the mug beneath. This will remove all of the grounds to leave you with a smooth cup of Turkish coffee you can enjoy.

What is The Best Way to Filter Turkish Coffee?
What is The Best Way to Filter Turkish Coffee?

A metal strainer will have several smaller holes that allow the liquid to pass through while keeping out any solids.

This type of strainer will work best for those who like their coffee with cream or sugar because it is easy to wash off and can be used again many times before needing replacement.

The only downside is that it takes longer than other methods since most metal strainers have fewer holes than any other type out there.

Since Turkish coffee grounds are extremely fine the metal strainer may not remove all of the grounds in your coffee but it will do a better job than if you didn’t strain it.

The metal strainer is also great for allowing all the oils in the coffee to seep through and end up in your coffee mug.

This is unlike other methods like a paper filter which ends up absorbing the coffee oils and reducing the level of flavor and strength.

Turkish coffee can also be filtered using a metal strainer
Turkish coffee can also be filtered using a metal strainer

Use a Paper Filter

A paper filter should do a better job at removing all the coffee grounds from your drink, but it can also absorb some of the coffee oils.

This type of filter is great for those who want a quick and easy way to make their Turkish coffee without having to worry about any grounds ending up in their cup.

The downside is that paper filters need to be replaced after each use so you’ll end up spending a lot more money on filters and it won’t be best for the environment.

As mentioned above, the paper will end up absorbing most of the coffee oils which give the cup of joe its flavor and quality.

Not only that, but the paper will also remove all of the foam that is quintessential for Turkish coffee.

Turkish coffee is best filtered using a paper filter
Turkish coffee is best filtered using a paper filter

Use a Cheese Cloth

A cheesecloth is going to be similar to using a paper filter except it won’t be quite as good since the fabric is not as tightly woven as a paper filter.

This does mean, however, that it will allow more of the coffee oils through to the cup and improve the overall experience.

The cheesecloth will ultimately remove the foam just like the paper filter option and remove part of the entire point of drinking a Turkish coffee.

You can also filter a Turkish coffee using a cheese cloth
You can also filter Turkish coffee using a cheesecloth

Don’t Stir Your Coffee Grounds

Turkish coffee is often stirred when it is brewing to help make the process go more smoothly.

To prevent the coffee grounds from mixing throughout the entire drink, do not stir your coffee while it is brewing.

Simply let the sugar and milk dissolve naturally into your coffee.

The less you agitate the coffee, the fewer grounds will end up freely floating within the entire drink and the grounds will stay at the bottom of the cup.

Don't stir the coffee grounds in a Turkish coffee
Don’t stir the coffee grounds in a Turkish coffee

Let The Grounds Settle Before Pouring

Since you’ll be pouring your Turkish coffee into your mug one simple step to take to ensure there are fewer grounds in your cup is to let the coffee grounds settle before you pour.

This can easily be done by waiting a minute or two after the coffee has finished brewing so that all of the grounds have had time to sink to the bottom.

Then, carefully pour off any liquid from the top and what’s left in your cup should be mostly free of any coffee grinds.

Frequently Asked Questions About What is The Best Way to Filter Turkish Coffee

How do you keep from drinking Turkish coffee grounds?

The best way to have your Turkish coffee is to not filter it at all because you will be preserving the oils and foam that make the quality of the drink what it is. There are ways you can limit the number of grounds that you end up drinking without using any kind of filter option that could alter the taste of your Turkish Coffee.

Are Americanos a good substitute for Turkish coffee?

There are many different types of coffee to choose from and Turkish coffee is a unique beverage that not everyone will appreciate. Americanos are another strong coffee drink that was invented because Americans couldn’t handle the strong coffee other parts of the world offered. To dilute the strong coffee, people started adding some more hot water to the mix so it isn’t as strong.

Are macchiatos a good substitute for Turkish coffee?

A macchiato is another strong drink made from espresso beans and has equal parts steamed milk and espresso. It gives you some creaminess with your strong drink without overpowering the flavor. You won’t find any grounds of coffee in a macchiato so it is made from an espresso machine that filters out all the grounds.

Conclusion About What is The Best Way to Filter Turkish Coffee

You can always filter your Turkish coffee using a paper filter or a metal filter but it will alter the taste and experience.

Paper options tend to absorb all the oils and foam while metal strainers aren’t quite good enough to keep all the grounds from falling through.

If drinking a cup of Turkish coffee ends up being too much of a hassle there are plenty of other coffee drinks you can try.



Source link

Know how to Extract Text Using Pattern


Regular expression allows you to find the pattern in the text. But the text you want to find is fixed. But if you use the rule base matching using Spacy then the text is matched using tokens, phrases, entities e.t.c which is a set of pre-defined patterns. To achieve it you have to use Spacy matcher.

There are three kinds of matching methods available as follows.

  1. Token Matcher
  2. Phrase Matcher
  3. Entity Ruler

In this entire tutorial, you will know how to perform rule base matching using Token Matcher.

What is Token Matcher

Spacy provides the rule-based matching engine that is Matcher. It operates on tokens extracted from text. The rule matcher also lets you pass in a custom callback to act on matches. All the matches are done using the patterns defined by the Matcher.

Steps to implement Token Matcher

In this entire section, you will know how to extract information by matching text as per defined patterns. But before going to the demonstration part make sure you have installed spacy in your system. Also, follow all the steps for better understanding.

Step 1: Import required package

The first step is to import all the required packages for implementing the spacy matcher. Here I am using the spacy package only and also importing Matcher. Use the below line of code to import them.

import spacy
from spacy.matcher import Matcher

Step 2: Load the Language model

There are many languages to implement Spacy matcher.  In my example, I am using the English language model so let’s load them using the spacy.load() method. But make sure you have downloaded the model in your system.

To download the model use the following command in your terminal.

nlp = spacy.load("en_core_web_sm")

Step 3: Call the Spacy Matcher

The third step is to call all the vocabulary of the NLP and pass it into the Matcher() constructor.

matcher = Matcher(nlp.vocab)

Step 4: Define the Pattern

Let’s create a pattern that will use to match the entire document and find the text according to that pattern. For example, I want to find an email address then I will define the pattern as below.

pattern = [{"LIKE_EMAIL":True}],

You can find more patterns on Spacy Documentation.

After that, you have to add the pattern to the Matcher that will be used for finding the text. Add the below line to add the pattern.

matcher.add("EMAIL",[pattern])

You can use any name for the pattern you want. In my case, I am defining the pattern name “EMAIL”.

Step 5: Apply the pattern

After defining the pattern now you have to apply this pattern to the document. For the sake of simplicity, I am creating a sample document. However, you can use your own document. Below is the document I have created.

text = "You can contact Data Science Learner through email address [email protected]"
doc = nlp(text)

After that pass the document as a parameter to the matcher.

matches = matcher(doc)

Step 6: Display the matched Text

The last step is to find the matched text from the document. In my case, it is an email address. There can be more than one match in the document. Therefore I have to run the loop over it. Add the following lines of code.

for match_id,start,end in matches:
    print(doc[start:end])

Here is the complete code. When you will run the code you will get all the email addresses in the document.

Complete Code

import spacy
from spacy.matcher import Matcher

nlp = spacy.load("en_core_web_sm")
matcher = Matcher(nlp.vocab)

pattern =[{"LIKE_EMAIL":True}]
matcher.add("EMAIL",[pattern])

text = "You can contact Data Science Learner through email address [email protected]"
doc = nlp(text)
matches = matcher(doc)

for match_id,start,end in matches:
    print(doc[start:end])

Output

Extracted email address from the document
Extracted email address from the document

 

You can also define more than one pattern and find the text in your document. For example, I also want to find all the names or nouns in the text then I will use the pattern [{“POS”: “PROPN”}].

Run the complete code given below. You will find all the names with the email address for the document.

import spacy
from spacy.matcher import Matcher

nlp = spacy.load("en_core_web_sm")
matcher = Matcher(nlp.vocab)

pattern = [[{"LIKE_EMAIL": True}], [{"POS": "PROPN"}]]
matcher.add("My_Pattern",pattern)

text = "You can contact Data Science Learner through email address [email protected]"
doc = nlp(text)
matches = matcher(doc)

for match_id,start,end in matches:
    print(doc[start:end])

Output

Extracting email and nouns from the document
Extracting email and nouns from the document

Conclusion

Spacy matcher is very useful for finding any text in a document using rule-based matching. There are many applications of it. For example, you can use it to extract email address, name, address e.t.c from an invoice in pdf format. These are the steps for implementing a spacy matcher. I hope you have liked this tutorial. If you have any queries then you can contact us for more help.

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.





Source link

Implement in 4 Steps Only


Spacy is the advanced python NLP packages. It is used for pre processing of the text. The best part of it is that it  is free and open source. There are many things you can do using Spacy like lemmatization, tokenizing, POS tag e.t.c on document. In this entire tutorial you will know how to implement spacy tokenizer through various steps.

But before going to the step part make sure you have installed spacy on your system.

Steps to implement Spacy Tokenizer

In this section you will know al the steps for tokenizing a document using the spacy. Make sure you should follow all the steps in order for better understanding .

Step 1: Import required libraries

The first and the basic step is to import all the necessary libraries. In my example I am suing Spacy package only. So lets impor it using  the import statement.

import spacy

Step 2: Load your language model

There are many languages where you can perform tokenizing. You can find them in spacy documentation. In my example, I am using the English language model so let’s load them using the spacy.load() method. But make sure you have downloaded the model in your system.

To download the model use the following command in your terminal.

python -m spacy download en_core_web_sm

Now you will use the nlp.load() method to load the english model. Add the below line of code.

nlp = spacy.load("en_core_web_sm")

Step 3: Create a NLP document

The third step is to create a document that will be use for implementing spacy tokenizer. To create a document you have to pass the string as an argument to nlp() constructor.

text ="Data Science Learner is the best site for data science I have ever seen."
doc = nlp(text)

Step 4: Implement spacy tokenizer on the document

Now lets implement spacy tokenizer on the created document. Here I have used an empty list that will contains all the tokens in a list. Execute the complete code and see the output.

import spacy
nlp = spacy.load("en_core_web_sm")
text ="Data Science Learner is the best site for data science I have ever seen."
doc = nlp(text)
empty_list = []
for token in doc:
    empty_list.append(token)
print(empty_list)

Output

Spacy tokenizer of a document
Spacy tokenizer of a document

You can see the text has tokenized and even the full stop has been considered.

Spacy also provides you to label the tokens. You have to use the doc.ents for defining the entity for the tokens. Suppose I have the Headline title of a news. I will be able to label the tokens using Spacy . Execute the below lines of code.

import spacy
nlp = spacy.load("en_core_web_sm")
text ="Remarks by President Biden on Rebuilding Our Manufacturing to Make More in America"
doc = nlp(text)
for ent in doc.ents:
    print(ent.text +' - ' + ent.label_ +' - ' + str(spacy.explain(ent.label_)) )

Output

Entity labeling of the Document
Entity labeling of the Document

You can see how the word Biden, America has been Labelled.

End Notes

Spacy is the best NLP package for pre processing of text. These are the steps for implementing spacy tokenizer in python. I hoe you have liked this tutorial. If you have any query then you can con for more help.

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.





Source link

spacy lemmatization Implementation in Python : 4 Steps only


Spacy is a free and open-source library for advanced Natural Language Processing(NLP) in Python. It is basically designed for production use and helps you to build applications that process and understand large volumes of text. In this tutorial, I will explain to you how to implement spacy lemmatization in python through steps.

What is a Spacy Lemmatization?

Lemmatization is one of the common text pre-processing tasks in NLP that reduces a given word to its root word. For example cars, car’s will be lemmatized into car. In the same way, are, is, am is lemmatized to be.

Steps to Implement Lemmatization

In this section, you will know all the steps required to implement spacy lemmatization. Make sure you have installed spacy in your system before following the steps. Also, you should follow all the steps for deep understanding.

Step 1: Import required package

The first step is to import all the necessary libraries. In my example, I am using spacy only so let’s import it using the import statement.

import spacy

Step 2: Load your language model

There are many languages where you can perform lemmatization. You can find them in spacy documentation. In my example, I am using the English language model so let’s load them using the spacy.load() method. But make sure you have downloaded the model in your system.

Download the English model

python -m spacy download en_core_web_sm

Load the English model

nlp = spacy.load("en_core_web_sm")

 

Step 3: Make a Sample Document

Before doing the spacy lemmatization let’s first make an NLP document. To do so you have to use nlp() method. Add the below line of code.

doc = nlp("Welcome to the Data Science Learner! . Here you will learn all things about data science , machine learning , artifical intelligence and more" )

Step 4: Implement spacy lemmatization on the document

Now the last step is to lemmatize the document you have created. To do so you have to use the for loop and pass each lemmatize word to the empty list. Execute the complete code given below.

import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("Welcome to the Data Science Learner! . Here you will learn all things about data science , machine learning , artifical intelligence and more." )
empty_list = []
for token in doc:
    empty_list.append(token.lemma_)

final_string = ' '.join(map(str,empty_list))
print(final_string)

Output

Spacy lemmatization output
Spacy lemmatization output

There are the steps for doing the spacy lemmatization of any document. Here I have used small text but you can use large documents for lemmatization. I hope you have liked this tutorial. If you have any queries then you can contact us for more help.

Source:

Spacy Language Model

Spacy Documentation

 

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.





Source link

How to Install Spacy in Juypter and Command Prompt?


Spacy is one of the best libraries for advanced NLP (Natural Language Processing ) in python. You can easily find the meaning of the words according to the context using them. Spacy allows you to build applications that understand and process large text to extract meaningful information. In this tutorial of “How to”, you will learn how to install Spacy in  Jupyter Notebook and Command Prompt using the pip command.

Install Spacy in Jupyter

In this section, you will learn how to install Spacy in Jupyter Notebook using the pip command. In the Jupyter notebook, you can run any Linux command or terminal command by adding the “!” character before the command. Open your Jupyter notebook and type the following command to install Spacy in your Jupyter Notebook.

!pip install spacy

It will successfully install the spacy in the notebook.

Installing spacy in jupyter notebook
Installing spacy in jupyter notebook

Installing Spacy in Windows

You can install spacy in widows using the pip command. But you have to also check the version of the python installed in your system. You can check using the below command.

python --version
Checking python version
Checking python version

If the version of the python is 3.xx+ then spacy will be installed using the pip3 command. I have python 3. xx installed so I will use the pip3 command.

pip3 install spacy
Installing spacy in windows
Installing spacy in windows

If you have previously installed spacy in your system then you will see the message Requirement already satisfied.

For version 2.xx+ install using the pip command.

pip install spacy

 

Install Spacy in Linux and MacOS.

If your system is Linux or MacOs then you will follow the same method described in the installation of spacy of windows. Open Your terminal and type the following command.

For Linux 

pip3 install spacy

For macOS

pip install -U pip setuptools wheel
pip install -U spacy

 

Installing Spacy on Anaconda

If you want to install spacy on Anaconda then you have to use the conda command. Open your anaconda terminal and type the following command. It will be successfully installed on your system.

conda install -c conda-forge spacy
python -m spacy download en_core_web_sm

 

Spacy is the best python package for NLP tasks. These are the method for installing spacy in the Jupyter notebook and your system. I hope you have liked this article. If you have any queries or are unable to install it then you can contact us for more help.

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.





Source link