Error message at decoding

Jan 4, 2013 at 5:03 AM
Edited Jan 4, 2013 at 5:05 AM

Dear all,

I would like to use CRFSharp to do some POStagging jobs.

First I downloaded source code and compiled it by Visual Studio 2012 on a Win7 laptop.

Then I feed my data set (it works under crf++), crfsharp works fine at encoding time.

Following are  the error messages showed at decoding time:

未處理的例外狀況: System.NullReferenceException: 並未將物件參考設定為物件的執行
個體。(means:object reference not set to an  instance of object)
   於 CRFSharpConsole.DecoderConsole.ConvertCRFTermOutToStringList(crf_out crf_o
ut)
   於 CRFSharpConsole.DecoderConsole.Decode(String strModelFileName, String strI
nputFileName, String strResultFileName)
   於 CRFSharpConsole.Program.Main(String[] args)

(I am sorry for post these Traditional Chinese messages since I use a Traditional Chinese system)

Did I do anything wrong? Or this is a bug?

Thank you for your help

Coordinator
Jan 5, 2013 at 1:39 PM

The exception is threw in post-process after decoding... It seems a bug. Since you have compiled it in VS2012, could you please help me to run the decoder in VS 2012 and tell me which code line throw exception out ? And then I can fix it.

Many thanks.

 

Jan 11, 2013 at 8:46 AM

I am sorry for replying late. The error message comes from DecoderConsole.cs line 131

String cto.x_ is empty so cto.x_.GetLength(0) leads to an exception.

The screen shot is here http://i.imgur.com/KEfGu.png

I hope i have provided enough information

Thank you

Coordinator
Jan 16, 2013 at 12:17 AM

Hi shinstar, 

Thank you for shared information. :) It's really helpful for me.

I have updated the code and checked in (code change:22501), please take a try again. Many thanks again. :)