Text Analysis:Error:Object reference not set to an instance of an object

I am trying to read the pdf file and after reading trying to do its Text analysis, but whenever i am trying to print the value of “Sentence”[Variable] ,I am getting an error message as Object reference not set to an instance of an object.
So please suggest me where I am going wrong.

NLPTest.xaml (14.1 KB)
Screenshot%20(688)

Regards,
Asmit

@Asmit_Anand1 Check wjhat result you are getting in text analysis activity because you are getting error object reference not set to am instance of an object this error occurs when variable is having null value

As mentioned below, is your Stanford Instance up and running on port 9000 while you execute this code?

In For Each change the type argument accordingly.

image

I am running it on the same port 9000 in different pc and i am using that link in my pc.

I changed the type argument in For Each loop as u said but still i am getting the same error . Please can you check my .XAML file once.
Here is the sample pdf file -
aditi.raikar123@gmail.com.pdf (315.2 KB)

Regards,
Asmit

Your error is thrown from For Each activity.
Is your collection having a value when reaching this step? If not null reference exception would be thrown.

I tried to check the value of Text analysis before For loop but then also still I am getting the same error.

Your Sentence collection is null at For Each Step. Something wrong with your Text Analysis activity

Thank you so much,
Is there any way to fix this ? :smiley:

Havent tried Cognitive activities before! I can try taking a look but would need some time.

Was trying to look into it.
It seems you can read the errors out of Text Analysis activity from its output.

Got a remote server error when I tried to run.
I am not sure if you are configuring the correct server address too.
But atleast this should help you debug where things are going wrong.

image

Thanks a lot for a quick reply :slight_smile:
I have done the server setup correctly because whenever i am trying to use this link [http://dd369128.ngrok.io] manually ,it gives the fine result. (I have done the server setup in different PC and using the same link on my PC.
Anyways i will try again.

Regards,
Asmit

1 Like