This project is read-only.

Error message at decoding

Jan 4, 2013 at 6:03 AM
Edited Jan 4, 2013 at 6: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
   於 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

Jan 5, 2013 at 2: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 9: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

I hope i have provided enough information

Thank you

Jan 16, 2013 at 1: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. :)