最近我一直在進行潛在語義分析。我通過使用Jama軟件包在java中實現了它。我們如何確定潛在語義分析的維數?
下面是代碼:
Matrix vtranspose ;
a = new Matrix(termdoc);
termdoc = a.getArray();
a = a.transpose() ;
SingularValueDecomposition sv =new SingularValueDecomposition(a) ;
u = sv.getU();
v = sv.getV();
s = sv.getS();
vtranspose = v.transpose() ; // we obtain this as a result of svd
uarray = u.getArray();
sarray = s.getArray();
varray = vtranspose.getArray();
if(semantics.maketerms.nodoc>50)
{
sarray_mod = new double[50][50];
uarray_mod = new double[uarray.length][50];
varray_mod = new double[50][varray.length];
move(sarray,50,50,sarray_mod);
move(uarray,uarray.length,50,uarray_mod);
move(varray,50,varray.length,varray_mod);
e = new Matrix(uarray_mod);
f = new Matrix(sarray_mod);
g = new Matrix(varray_mod);
Matrix temp =e.times(f);
result = temp.times(g);
}
else
{
Matrix temp = u.times(s);
result = temp.times(vtranspose);
}
result = result.transpose();
results = result.getArray() ;
return results ;
但是怎樣確定的維數?有沒有一種方法可以確定系統應該減少的維數以獲得最佳結果?我們考慮哪些其他參數來提高LSA的有效性能?