[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-11 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/nutch/pull/87


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51668551
  
--- Diff: src/plugin/scoring-similarity/build.xml ---
@@ -18,7 +18,15 @@
 
 
   
-
+ 
+   
--- End diff --

Why are you relying upon the indexer-elastic plugin?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51668463
  
--- Diff: conf/nutch-default.xml ---
@@ -1390,7 +1390,7 @@ For more detailed information on the working of this 
filter
 visit https://wiki.apache.org/nutch/SimilarityScoringFilter-->
 
 
-scoring.similarity.model.path
+cosine.goldstandard.file
 goldstandard.txt
 Path to the gold standard file which contains all the 
relevant text and terms, 
--- End diff --

Is this description correct given the fact that it is a model now instead 
of a gold standard file?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51668569
  
--- Diff: src/plugin/scoring-similarity/build.xml ---
@@ -18,7 +18,15 @@
 
 
   
-
+ 
+   
+ 
+ 
+ 
+   
+ 
--- End diff --

Same here, why are you relying upon the indexer-elastic plugin?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51668748
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/SimilarityScoringFilter.java
 ---
@@ -43,7 +43,11 @@ public Configuration getConf() {
   @Override
   public void setConf(Configuration conf) {
 this.conf = conf;
-similarityModel = new CosineSimilarityModel();
+switch(conf.get("scoring.similarity.model","cosine")){
--- End diff --

This property does not yet exist in nutch-default.xml it needs to be added


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51668868
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/cosine/Model.java
 ---
@@ -0,0 +1,134 @@
+package org.apache.nutch.scoring.similarity.cosine;
--- End diff --

License header?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51668910
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/cosine/package-info.java
 ---
@@ -0,0 +1,7 @@
+/**
--- End diff --

License header


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51668940
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/util/LuceneTokenizer.java
 ---
@@ -0,0 +1,116 @@
+package org.apache.nutch.scoring.similarity.util;
--- End diff --

License header


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread lewismc
Github user lewismc commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51668965
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/util/package-info.java
 ---
@@ -0,0 +1,8 @@
+/**
--- End diff --

License header


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread sujen1412
Github user sujen1412 commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51670857
  
--- Diff: conf/nutch-default.xml ---
@@ -1390,7 +1390,7 @@ For more detailed information on the working of this 
filter
 visit https://wiki.apache.org/nutch/SimilarityScoringFilter-->
 
 
-scoring.similarity.model.path
+cosine.goldstandard.file
 goldstandard.txt
 Path to the gold standard file which contains all the 
relevant text and terms, 
--- End diff --

It is a goldstandard file now and the model containing the term vector gets 
created at runtime. I felt the earlier name was misleading and given that we 
could have more similarity metrics in the future,  I renamed it. 
Later on if we can incorporate the idea of a corpus of documents, we can 
rename it to something like cosine.corpus.path ? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread sujen1412
Github user sujen1412 commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51670910
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/cosine/Model.java
 ---
@@ -0,0 +1,134 @@
+package org.apache.nutch.scoring.similarity.cosine;
--- End diff --

Correcting these now. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-02 Thread sujen1412
Github user sujen1412 commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51670893
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/SimilarityScoringFilter.java
 ---
@@ -43,7 +43,11 @@ public Configuration getConf() {
   @Override
   public void setConf(Configuration conf) {
 this.conf = conf;
-similarityModel = new CosineSimilarityModel();
+switch(conf.get("scoring.similarity.model","cosine")){
--- End diff --

Will do. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-01 Thread chrismattmann
Github user chrismattmann commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51521777
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/cosine/Model.java
 ---
@@ -0,0 +1,135 @@
+package org.apache.nutch.scoring.similarity.cosine;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.util.StringUtils;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+import 
org.apache.nutch.scoring.similarity.util.LuceneAnalyzerUtil.StemFilterType;
+import org.apache.nutch.scoring.similarity.util.LuceneTokenizer;
+import 
org.apache.nutch.scoring.similarity.util.LuceneTokenizer.TokenizerType;
+import org.apache.tika.Tika;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class creates a model used to store Document vector representation 
of the corpus. 
+ * @author Sujen Shah
--- End diff --

no author tags.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-01 Thread chrismattmann
Github user chrismattmann commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51521811
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/util/LuceneAnalyzerUtil.java
 ---
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nutch.scoring.similarity.util;
+
+import java.io.Reader;
+import java.util.List;
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.analysis.Tokenizer;
+import org.apache.lucene.analysis.core.LowerCaseFilter;
+import org.apache.lucene.analysis.core.StopFilter;
+import org.apache.lucene.analysis.en.EnglishMinimalStemFilter;
+import org.apache.lucene.analysis.en.PorterStemFilter;
+import org.apache.lucene.analysis.standard.ClassicTokenizer;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.analysis.util.CharArraySet;
+
+/**
+ * Creates a custom analyzer based on user provided inputs
+ * @author Sujen Shah
--- End diff --

remove author tags.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-01 Thread chrismattmann
Github user chrismattmann commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51521822
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/util/LuceneIndexManager.java
 ---
@@ -0,0 +1,113 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nutch.scoring.similarity.util;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.util.StringUtils;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.FieldType;
+import org.apache.lucene.index.AtomicReader;
+import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.Fields;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.MultiFields;
+import org.apache.lucene.index.SegmentReader;
+import org.apache.lucene.index.SlowCompositeReaderWrapper;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.NIOFSDirectory;
+import org.apache.lucene.store.RAMDirectory;
+import org.apache.lucene.util.Version;
+import 
org.apache.nutch.scoring.similarity.util.LuceneAnalyzerUtil.StemFilterType;
+import org.apache.tika.Tika;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.sun.org.apache.xalan.internal.xsltc.compiler.sym;
+
+/**
+ * This class provides the functionality to read/write Lucene indexes
+ * @author Sujen Shah
--- End diff --

no author tags.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-01 Thread chrismattmann
Github user chrismattmann commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51521837
  
--- Diff: 
src/plugin/scoring-similarity/src/java/org/apache/nutch/scoring/similarity/util/package-info.java
 ---
@@ -0,0 +1,8 @@
+/**
+ * 
+ */
+/**
+ * @author Sujen Shah
--- End diff --

remove author tag


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-02-01 Thread chrismattmann
Github user chrismattmann commented on a diff in the pull request:

https://github.com/apache/nutch/pull/87#discussion_r51521738
  
--- Diff: ivy/ivy.xml ---
@@ -87,7 +87,8 @@
  
 

-  
+
+
--- End diff --

do we have to have this in the main ivy.xml?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nutch pull request: Fix for NUTCH-2209 : Improved Tokenization for...

2016-01-31 Thread sujen1412
GitHub user sujen1412 opened a pull request:

https://github.com/apache/nutch/pull/87

Fix for NUTCH-2209 : Improved Tokenization for Similarity Scoring plugin 
(Sujen)



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/sujen1412/nutch NUTCH-2209

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nutch/pull/87.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #87


commit 9be9bb9c6288e8f0a26cda4457e19a3bcf67b409
Author: Sujen Shah 
Date:   2015-10-09T03:20:42Z

Refactoring cosine similarity code




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---