none
Cognitive extractors

    Question

  • I followed the instructions this Saturday (July 14, 2018) in https://docs.microsoft.com/en-us/azure/data-lake-analytics/data-lake-analytics-u-sql-cognitive to set up cognitive services on my data lake.  I tried running one of the image scripts and the text script and I get related errors (at the end).  What can I do to fix the problem?  It looks like an old fashioned DLL hell issue.

    Component
    CSC
    Message
    C# error CS0029: Cannot implicitly convert type 'Cognition.Text.KeyPhraseExtractor' to 'Microsoft.Analytics.Interfaces.IProcessor'
    Resolution
    Make sure that a valid C# expression is specified.
    Description
    C# compiler reported that this expression is not valid C#.
    Details
    at token 'new', line 34
    near the ###:
    **************
       Chapter,
                Text,
                KeyPhrase string
        READONLY No,
                Year,
                Book,
                Chapter,
                Text
        USING  ### new Cognition.Text.KeyPhraseExtractor();

    The second error was:

    Component
    RUNTIME
    Message
    An unhandled exception from user code has been reported when invoking the method 'Constructor' on the user type 'Cognition.Vision.EmotionExtractor'
    Resolution
    Make sure the bug in the user code is fixed.
    Description
    Unhandled exception from user code: "Unable to load data model"
    The details includes more information including any inner exceptions and the stack trace where the exception was raised.
    Details
    ==== Caught exception Microsoft.ProjectOxford.Emotion.RecognizerException

       at Microsoft.ProjectOxford.Emotion.RecognizerModel.LoadModel(String modelPath)
       at Cognition.Vision.EmotionAnalysisGenerator..ctor()
       at Cognition.Vision.EmotionExtractor..ctor(String numCol, String indexCol, String emtCol, String confCol)
       at ___Scope_Generated_Classes___.__OperatorFactory__.Create_Extract_0() in d:\data\yarnnm\local\usercache\8b427f82-8e35-4d57-8647-7ac148b921b9\appcache\application_1531533882057_435387\container_e296_1531533882057_435387_01_000001\wd\__ScopeCodeGen__.dll.cs:line 59
       at ScopeEngine.ManagedUDO<1>.{ctor}(ManagedUDO<1>* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* argv, Int32 argc) in d:\data\yarnnm\local\usercache\8b427f82-8e35-4d57-8647-7ac148b921b9\appcache\application_1531533882057_435387\container_e296_1531533882057_435387_01_000001\wd\__scopecodegenengine__.dll.cpp:line 1192

    ==== Inner exception System.Runtime.InteropServices.SEHException

    External component has thrown an exception.

       at MIX.Emotion.EmotionRecognitionModel.Load(EmotionRecognitionModel* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* )
       at Microsoft.ProjectOxford.Emotion.RecognizerModel.LoadModel(String modelPath)


    Russel Loski, MCSE Data Platform/Business Intelligence Twitter: @sqlmovers; blog: www.sqlmovers.com

    Monday, July 16, 2018 4:12 PM

Answers

  • Hello Russ,

    Seems like samples which you are following are out of date. For users convivence, when after the install the usql advance extension in there ADLA account- we create a directory which contains all the sample of usql extension (cognitive, python and R). To get to those sample go to your ADLA account, then click "Data explorer".  Then go to "Usqlext" folder, followed by "Samples" folder. Under Samples folder you will find working examples for cognitive, python and R extension.

    I hope this helps

    Thanks,

    Hiren

    • Marked as answer by Russ Loski Thursday, July 19, 2018 1:04 AM
    Wednesday, July 18, 2018 6:28 PM
  • Follow-up.  I found that I was one build behind on my VS Azure Data Lake Analytics Add-in.  I updated VS 2017, then installed the latest Addin and I was able to run my U-SQL script from VS 2017.

    I also found that copying the Sample script from the portal, as Hiren suggested, was necessary.

    Thanks for the help.


    Russel Loski, MCSE Data Platform/Business Intelligence Twitter: @sqlmovers; blog: www.sqlmovers.com

    • Marked as answer by Russ Loski Thursday, July 19, 2018 1:41 PM
    Thursday, July 19, 2018 1:41 PM

All replies

  • I have tried to reach the author of this article to get an answer. I will let you know when i get an response.
    Tuesday, July 17, 2018 8:20 PM
    Moderator
  • Hello Russ,

    Seems like samples which you are following are out of date. For users convivence, when after the install the usql advance extension in there ADLA account- we create a directory which contains all the sample of usql extension (cognitive, python and R). To get to those sample go to your ADLA account, then click "Data explorer".  Then go to "Usqlext" folder, followed by "Samples" folder. Under Samples folder you will find working examples for cognitive, python and R extension.

    I hope this helps

    Thanks,

    Hiren

    • Marked as answer by Russ Loski Thursday, July 19, 2018 1:04 AM
    Wednesday, July 18, 2018 6:28 PM
  • I tried that file from the samples folder and it worked.

    But then I realized I had introduced a new variable.  I used the portal with the files I downloaded from the portal rather than Visual Studio 2017.  So I ran the script that had just worked in the portal on VS 2017 and I got the same error.

    I will look into updating my VS Add in tomorrow to see if that is the problem.  If it is, I'm glad I caught it.


    Russel Loski, MCSE Data Platform/Business Intelligence Twitter: @sqlmovers; blog: www.sqlmovers.com

    Thursday, July 19, 2018 1:06 AM
  • Follow-up.  I found that I was one build behind on my VS Azure Data Lake Analytics Add-in.  I updated VS 2017, then installed the latest Addin and I was able to run my U-SQL script from VS 2017.

    I also found that copying the Sample script from the portal, as Hiren suggested, was necessary.

    Thanks for the help.


    Russel Loski, MCSE Data Platform/Business Intelligence Twitter: @sqlmovers; blog: www.sqlmovers.com

    • Marked as answer by Russ Loski Thursday, July 19, 2018 1:41 PM
    Thursday, July 19, 2018 1:41 PM