invalid SVD exception in LatentSemanticAnalysis

122 views
Skip to first unread message

Sana Ben nasr

unread,
May 13, 2013, 4:23:59 AM5/13/13
to s-space-re...@googlegroups.com
Hi,

I downloaded lsa.jar and created a corpus and tried to run it and got the following error: 

java.lang.UnsupportedOperationException: Cannot find a valid SVD implementation
at edu.ucla.sspace.matrix.SVD.getFastestAvailableFactorization(SVD.java:156)
at edu.ucla.sspace.lsa.LatentSemanticAnalysis.<init>(LatentSemanticAnalysis.java:289)

What can I do to get it to work?

Thank you for your help. 

Sana BEN NASR 

tuxdna

unread,
May 13, 2013, 4:45:51 AM5/13/13
to s-space-re...@googlegroups.com
I believe you need to install at-least one of the following on your system:
* SVDLIBC [1]
* Octave [2]
* Matlab [2]

This is evident from the source-code [4]. I hope that helps.

Regards,
Saleem

[1] https://github.com/lucasmaystre/svdlibc
[2] http://www.gnu.org/software/octave/
[3] http://www.mathworks.in/products/matlab/
[4] https://github.com/fozziethebeat/S-Space/blob/master/src/main/java/edu/ucla/sspace/matrix/SVD.java#L156
> --
> You received this message because you are subscribed to the Google Groups
> "Semantic Space Research - Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to s-space-research...@googlegroups.com.
> To post to this group, send email to s-space-re...@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/s-space-research-dev?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

David Jurgens

unread,
May 13, 2013, 5:51:05 AM5/13/13
to s-space-re...@googlegroups.com
Hi Sana,

  Saleem is correct (thanks Saleem!), you're seeing that expcetion because it can't find any program to run the SVD.  Do you know if you have one installed?

  Thanks,
  David

Johann Petrak

unread,
Oct 3, 2014, 2:34:05 PM10/3/14
to s-space-re...@googlegroups.com
I just got the same error message with the very last release (2.0.4).
This happened as a result of
  new VectorSpaceModel()

What I find confusing is that this happens even though one may never want to do any SVD.
Also the code I found is puzzling to me:

The SVD.getFastestAvailableAlgorithm() method throws an exception if no SVD algorithm is found, but the caller,
Matrices.getMatrixBuilderForSVD at line 249 checks if the returned value is null, using some default if it is. But since the called method throws an exception the value null will never be returned.
Would it not be possible to simply replace throwing the exception by a "return null" then?

Thanks,
  johann
  David

To unsubscribe from this group and stop receiving emails from it, send an email to s-space-research-dev+unsub...@googlegroups.com.

David Jurgens

unread,
Oct 3, 2014, 5:53:06 PM10/3/14
to s-space-re...@googlegroups.com
Hi Johann,

I just got the same error message with the very last release (2.0.4).
This happened as a result of
  new VectorSpaceModel()

What I find confusing is that this happens even though one may never want to do any SVD.

This is an unintended consequence of that particular code path.  Both LSA and VSM use an on-disk representation to stream the corpus to disk; since they share a common base class, VSM ends up using the base class's code to chose the on-disk format that best suits the anticipated SVD call.  However since no SVD is ever performed, this isn't needed, as you note.  I've updated the default VSM constructor to avoid this svd-check altogether so the class should "just work" even when no SVD program is available.
 
  Thanks,
  David

To unsubscribe from this group and stop receiving emails from it, send an email to s-space-research...@googlegroups.com.

To post to this group, send email to s-space-re...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages