public override void Compute() { TermDocumentMatrix sourceArtifacts = SmoothingFilter.Compute(new TermDocumentMatrix((TLArtifactsCollection)Workspace.Load("SourceArtifacts"))); TermDocumentMatrix targetArtifacts = SmoothingFilter.Compute(new TermDocumentMatrix((TLArtifactsCollection)Workspace.Load("TargetArtifacts"))); TLSimilarityMatrix sims = VSM.Compute(sourceArtifacts, targetArtifacts); Workspace.Store("Similarities", sims); }
public override void Compute() { TLArtifactsCollection sourceArtifacts = (TLArtifactsCollection)Workspace.Load("SourceArtifacts"); TLArtifactsCollection targetArtifacts = (TLArtifactsCollection)Workspace.Load("TargetArtifacts"); TermDocumentMatrix matrix = new TermDocumentMatrix(sourceArtifacts, targetArtifacts); matrix = SmoothingFilter.Compute(matrix, sourceArtifacts.Keys); matrix = SmoothingFilter.Compute(matrix, targetArtifacts.Keys); TLSimilarityMatrix sims = SimilarityUtil.ComputeCosine(matrix, sourceArtifacts.Keys, targetArtifacts.Keys); Workspace.Store("Similarities", sims); }