You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(14) |
Nov
(37) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(14) |
Feb
|
Mar
|
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(2) |
2003 |
Jan
(4) |
Feb
|
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2004 |
Jan
(1) |
Feb
(3) |
Mar
|
Apr
|
May
(4) |
Jun
(3) |
Jul
(1) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(17) |
Nov
(3) |
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(23) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
(7) |
Apr
(17) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(20) |
Oct
|
Nov
(15) |
Dec
(2) |
2009 |
Jan
(38) |
Feb
(4) |
Mar
(20) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
(17) |
Sep
(26) |
Oct
|
Nov
(2) |
Dec
|
From: Joern K. <joe...@us...> - 2009-01-22 23:23:42
|
Update of /cvsroot/maxent/maxent/src/test/resources/data/opennlp/maxent In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/test/resources/data/opennlp/maxent Added Files: real-valued-weights-training-data.txt repeat-weighting-training-data.txt Log Message: Introduced maven build. --- NEW FILE: real-valued-weights-training-data.txt --- A feature1=4.0 feature3=10.0 feature4=2.0 A feature1=2.0 feature2=4.0 feature4=3.0 A feature2=5.0 feature3=12.0 feature4=4.0 A feature1=1.0 feature3=11.0 feature4=3.0 A feature1=4.0 feature2=5.0 feature4=2.0 A feature1=3.0 feature2=4.0 feature3=9.0 A feature2=3.0 feature3=11.0 feature4=2.0 A feature1=1.0 feature3=12.0 A feature2=6.0 feature3=12.0 feature4=3.0 A feature1=3.0 feature2=7.0 feature3=11.0 B feature5=4.0 feature2=1.0 feature4=10.0 B feature2=1.0 feature3=11.0 B feature5=3.0 feature4=12.0 B feature2=1.0 feature3=11.0 B feature5=4.0 feature4=10.0 B feature2=1.0 feature3=9.0 B feature5=2.0 feature4=11.0 B feature2=1.0 feature3=12.0 B feature5=4.0 feature4=12.0 B feature2=1.0 feature3=11.0 feature4=4.0 --- NEW FILE: repeat-weighting-training-data.txt --- A feature1 feature1 feature1 feature1 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature4 feature4 A feature1 feature1 feature2 feature2 feature2 feature2 feature4 feature4 feature4 A feature2 feature2 feature2 feature2 feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature4 feature4 feature4 feature4 A feature1 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature4 feature4 feature4 A feature1 feature1 feature1 feature1 feature2 feature2 feature2 feature2 feature2 feature4 feature4 A feature1 feature1 feature1 feature2 feature2 feature2 feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 A feature2 feature2 feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature4 feature4 A feature1 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 A feature2 feature2 feature2 feature2 feature2 feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature4 feature4 feature4 A feature1 feature1 feature1 feature2 feature2 feature2 feature2 feature2 feature2 feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 B feature5 feature5 feature5 feature5 feature2 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 B feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 B feature5 feature5 feature5 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 B feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 B feature5 feature5 feature5 feature5 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 B feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 B feature5 feature5 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 B feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 B feature5 feature5 feature5 feature5 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 feature4 B feature2 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature3 feature4 feature4 feature4 feature4 |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:42
|
Update of /cvsroot/maxent/maxent In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001 Modified Files: build.xml Added Files: pom.xml Log Message: Introduced maven build. --- NEW FILE: pom.xml --- <?xml version="1.0" encoding="UTF-8"?> <!-- 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. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>opennlp</groupId> <artifactId>maxent</artifactId> <packaging>jar</packaging> <version>3.0-SNAPSHOT</version> <name>OpenNLP Maxent</name> <url>http://maven.apache.org</url> <licenses> <license> <name>The Apache Software License, Version 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> </license> </licenses> <scm> <url>http://maxent.cvs.sourceforge.net/viewvc/maxent/</url> </scm> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2-beta-2</version> <configuration> <descriptors> <descriptor>src/main/assembly/src.xml</descriptor> </descriptors> </configuration> </plugin> </plugins> </build> </project> Index: build.xml =================================================================== RCS file: /cvsroot/maxent/maxent/build.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** build.xml 28 Sep 2008 18:04:21 -0000 1.27 --- build.xml 22 Jan 2009 23:23:35 -0000 1.28 *************** *** 1,4 **** --- 1,23 ---- <!-- $Id$ --> + <!-- + 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. + --> + <project default="package" basedir="."> *************** *** 19,23 **** <property name="deprecation" value="on"/> ! <property name="src.dir" value="./src/java"/> <property name="lib.dir" value="./lib"/> <property name="packages" value="opennlp.maxent.*"/> --- 38,42 ---- <property name="deprecation" value="on"/> ! <property name="src.dir" value="./src/main/java"/> <property name="lib.dir" value="./lib"/> <property name="packages" value="opennlp.maxent.*"/> *************** *** 191,195 **** </target> ! </project> ! ! <!-- End of file --> --- 210,212 ---- </target> ! </project> \ No newline at end of file |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:42
|
Update of /cvsroot/maxent/maxent/src/test/java/opennlp/maxent In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/test/java/opennlp/maxent Added Files: RealValueModelTest.java Log Message: Introduced maven build. --- NEW FILE: RealValueModelTest.java --- package opennlp.maxent; import java.io.IOException; import opennlp.model.FileEventStream; import opennlp.model.OnePassRealValueDataIndexer; import opennlp.model.RealValueFileEventStream; import junit.framework.TestCase; public class RealValueModelTest extends TestCase { public void testRealValuedWeightsVsRepeatWeighting() throws IOException { RealValueFileEventStream rvfes1 = new RealValueFileEventStream("src/test/resources/data/opennlp/maxent/real-valued-weights-training-data.txt"); GISModel realModel = GIS.trainModel(100,new OnePassRealValueDataIndexer(rvfes1,1)); FileEventStream rvfes2 = new FileEventStream("src/test/resources/data/opennlp/maxent/repeat-weighting-training-data.txt"); GISModel repeatModel = GIS.trainModel(100,new OnePassRealValueDataIndexer(rvfes2,1)); String[] features2Classify = new String[] {"feature2","feature5"}; double[] realResults = realModel.eval(features2Classify); double[] repeatResults = repeatModel.eval(features2Classify); assertEquals(realResults.length, repeatResults.length); for(int i=0; i<realResults.length; i++) { assertEquals(realResults[i], repeatResults[i], 0.01f); System.out.println(String.format("classifiy with realModel: %1$s = %2$f", realModel.getOutcome(i), realResults[i])); System.out.println(String.format("classifiy with repeatModel: %1$s = %2$f", repeatModel.getOutcome(i), repeatResults[i])); } features2Classify = new String[] {"feature1","feature2","feature3","feature4","feature5"}; realResults = realModel.eval(features2Classify, new float[] {5.5f, 6.1f, 9.1f, 4.0f, 1.8f}); repeatResults = repeatModel.eval(features2Classify, new float[] {5.5f, 6.1f, 9.1f, 4.0f, 1.8f}); System.out.println(); assertEquals(realResults.length, repeatResults.length); for(int i=0; i<realResults.length; i++) { assertEquals(realResults[i], repeatResults[i], 0.01f); System.out.println(String.format("classifiy with realModel: %1$s = %2$f", realModel.getOutcome(i), realResults[i])); System.out.println(String.format("classifiy with repeatModel: %1$s = %2$f", repeatModel.getOutcome(i), repeatResults[i])); } } } |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:42
|
Update of /cvsroot/maxent/maxent/src/test/java/opennlp/maxent/io In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/test/java/opennlp/maxent/io Added Files: RealValueFileEventStreamTest.java Log Message: Introduced maven build. --- NEW FILE: RealValueFileEventStreamTest.java --- package opennlp.maxent.io; import java.io.IOException; import junit.framework.TestCase; import opennlp.model.OnePassRealValueDataIndexer; import opennlp.model.RealValueFileEventStream; public class RealValueFileEventStreamTest extends TestCase { public void testLastLineBug() throws IOException { RealValueFileEventStream rvfes = new RealValueFileEventStream("src/test/resources/data/opennlp/maxent/io/rvfes-bug-data-ok.txt"); OnePassRealValueDataIndexer indexer = new OnePassRealValueDataIndexer(rvfes, 1); assertEquals(1, indexer.getOutcomeLabels().length); rvfes = new RealValueFileEventStream("src/test/resources/data/opennlp/maxent/io/rvfes-bug-data-broken.txt"); indexer = new OnePassRealValueDataIndexer(rvfes, 1); assertEquals(1, indexer.getOutcomeLabels().length); } } |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:42
|
Update of /cvsroot/maxent/maxent/test/src/opennlp/maxent In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/test/src/opennlp/maxent Removed Files: RealValueModelTests.java Log Message: Introduced maven build. --- RealValueModelTests.java DELETED --- |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:41
|
Update of /cvsroot/maxent/maxent/test/data/opennlp/maxent/io In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/test/data/opennlp/maxent/io Removed Files: rvfes-bug-data-ok.txt rvfes-bug-data-broken.txt Log Message: Introduced maven build. --- rvfes-bug-data-ok.txt DELETED --- --- rvfes-bug-data-broken.txt DELETED --- |
Update of /cvsroot/maxent/maxent/src/main/java/opennlp/maxent/io In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/main/java/opennlp/maxent/io Added Files: BinaryGISModelWriter.java PlainTextGISModelWriter.java ObjectGISModelReader.java BinaryGISModelReader.java GISModelWriter.java OldFormatGISModelReader.java PooledGISModelReader.java ObjectGISModelWriter.java PlainTextGISModelReader.java SuffixSensitiveGISModelReader.java BinToAscii.java package.html SuffixSensitiveGISModelWriter.java GISModelReader.java Log Message: Introduced maven build. --- NEW FILE: BinaryGISModelWriter.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import opennlp.maxent.*; import opennlp.model.AbstractModel; import java.io.*; import java.util.zip.*; /** * Model writer that saves models in binary format. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public class BinaryGISModelWriter extends GISModelWriter { DataOutputStream output; /** * Constructor which takes a GISModel and a File and prepares itself to * write the model to that file. Detects whether the file is gzipped or not * based on whether the suffix contains ".gz". * * @param model The GISModel which is to be persisted. * @param f The File in which the model is to be persisted. */ public BinaryGISModelWriter (AbstractModel model, File f) throws IOException { super(model); if (f.getName().endsWith(".gz")) { output = new DataOutputStream( new GZIPOutputStream(new FileOutputStream(f))); } else { output = new DataOutputStream(new FileOutputStream(f)); } } /** * Constructor which takes a GISModel and a DataOutputStream and prepares * itself to write the model to that stream. * * @param model The GISModel which is to be persisted. * @param dos The stream which will be used to persist the model. */ public BinaryGISModelWriter (AbstractModel model, DataOutputStream dos) { super(model); output = dos; } public void writeUTF (String s) throws java.io.IOException { output.writeUTF(s); } public void writeInt (int i) throws java.io.IOException { output.writeInt(i); } public void writeDouble (double d) throws java.io.IOException { output.writeDouble(d); } public void close () throws java.io.IOException { output.flush(); output.close(); } } --- NEW FILE: PlainTextGISModelWriter.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.zip.GZIPOutputStream; import opennlp.model.AbstractModel; /** * Model writer that saves models in plain text format. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public class PlainTextGISModelWriter extends GISModelWriter { BufferedWriter output; /** * Constructor which takes a GISModel and a File and prepares itself to * write the model to that file. Detects whether the file is gzipped or not * based on whether the suffix contains ".gz". * * @param model The GISModel which is to be persisted. * @param f The File in which the model is to be persisted. */ public PlainTextGISModelWriter (AbstractModel model, File f) throws IOException, FileNotFoundException { super(model); if (f.getName().endsWith(".gz")) { output = new BufferedWriter(new OutputStreamWriter( new GZIPOutputStream(new FileOutputStream(f)))); } else { output = new BufferedWriter(new FileWriter(f)); } } /** * Constructor which takes a GISModel and a BufferedWriter and prepares * itself to write the model to that writer. * * @param model The GISModel which is to be persisted. * @param bw The BufferedWriter which will be used to persist the model. */ public PlainTextGISModelWriter (AbstractModel model, BufferedWriter bw) { super(model); output = bw; } public void writeUTF (String s) throws java.io.IOException { output.write(s); output.newLine(); } public void writeInt (int i) throws java.io.IOException { output.write(Integer.toString(i)); output.newLine(); } public void writeDouble (double d) throws java.io.IOException { output.write(Double.toString(d)); output.newLine(); } public void close () throws java.io.IOException { output.flush(); output.close(); } } --- NEW FILE: ObjectGISModelReader.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.ObjectInputStream; import opennlp.model.ObjectDataReader; public class ObjectGISModelReader extends GISModelReader { protected ObjectInputStream input; /** * Constructor which directly instantiates the ObjectInputStream containing * the model contents. * * @param dis The DataInputStream containing the model information. */ public ObjectGISModelReader(ObjectInputStream ois) { super(new ObjectDataReader(ois)); } } --- NEW FILE: BinaryGISModelReader.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.DataInputStream; import opennlp.model.BinaryFileDataReader; /** * A reader for GIS models stored in binary format. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public class BinaryGISModelReader extends GISModelReader { /** * Constructor which directly instantiates the DataInputStream containing * the model contents. * * @param dis The DataInputStream containing the model information. */ public BinaryGISModelReader (DataInputStream dis) { super(new BinaryFileDataReader(dis)); } } --- NEW FILE: GISModelWriter.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import opennlp.model.AbstractModel; import opennlp.model.AbstractModelWriter; import opennlp.model.ComparablePredicate; import opennlp.model.Context; /** * Abstract parent class for GISModel writers. It provides the persist method * which takes care of the structure of a stored document, and requires an * extending class to define precisely how the data should be stored. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public abstract class GISModelWriter extends AbstractModelWriter { protected Context[] PARAMS; protected String[] OUTCOME_LABELS; protected int CORRECTION_CONSTANT; protected double CORRECTION_PARAM; protected String[] PRED_LABELS; public GISModelWriter (AbstractModel model) { Object[] data = model.getDataStructures(); PARAMS = (Context[]) data[0]; Map<String,Integer> pmap = (Map<String,Integer>)data[1]; OUTCOME_LABELS = (String[])data[2]; CORRECTION_CONSTANT = ((Integer)data[3]).intValue(); CORRECTION_PARAM = ((Double)data[4]).doubleValue(); PRED_LABELS = new String[pmap.size()]; for (String pred : pmap.keySet()) { PRED_LABELS[pmap.get(pred)] = pred; } } /** * Writes the model to disk, using the <code>writeX()</code> methods * provided by extending classes. * * <p>If you wish to create a GISModelWriter which uses a different * structure, it will be necessary to override the persist method in * addition to implementing the <code>writeX()</code> methods. */ public void persist() throws IOException { // the type of model (GIS) writeUTF("GIS"); // the value of the correction constant writeInt(CORRECTION_CONSTANT); // the value of the correction constant writeDouble(CORRECTION_PARAM); // the mapping from outcomes to their integer indexes writeInt(OUTCOME_LABELS.length); for (int i=0; i<OUTCOME_LABELS.length; i++) writeUTF(OUTCOME_LABELS[i]); // the mapping from predicates to the outcomes they contributed to. // The sorting is done so that we actually can write this out more // compactly than as the entire list. ComparablePredicate[] sorted = sortValues(); List compressed = compressOutcomes(sorted); writeInt(compressed.size()); for (int i=0; i<compressed.size(); i++) { List a = (List)compressed.get(i); writeUTF(a.size() + ((ComparablePredicate)a.get(0)).toString()); } // the mapping from predicate names to their integer indexes writeInt(PARAMS.length); for (int i=0; i<sorted.length; i++) writeUTF(sorted[i].name); // write out the parameters for (int i=0; i<sorted.length; i++) for (int j=0; j<sorted[i].params.length; j++) writeDouble(sorted[i].params[j]); close(); } protected ComparablePredicate[] sortValues () { ComparablePredicate[] sortPreds = new ComparablePredicate[PARAMS.length]; int numParams = 0; for (int pid=0; pid<PARAMS.length; pid++) { int[] predkeys = PARAMS[pid].getOutcomes(); //Arrays.sort(predkeys); int numActive = predkeys.length; int[] activeOutcomes = predkeys; double[] activeParams = PARAMS[pid].getParameters(); numParams += numActive; /* double[] activeParams = new double[numActive]; int id = 0; for (int i=0; i < predkeys.length; i++) { int oid = predkeys[i]; activeOutcomes[id] = oid; activeParams[id] = PARAMS[pid].getParams(oid); id++; } */ sortPreds[pid] = new ComparablePredicate(PRED_LABELS[pid], activeOutcomes, activeParams); } Arrays.sort(sortPreds); return sortPreds; } protected List compressOutcomes (ComparablePredicate[] sorted) { ComparablePredicate cp = sorted[0]; List outcomePatterns = new ArrayList(); List newGroup = new ArrayList(); for (int i=0; i<sorted.length; i++) { if (cp.compareTo(sorted[i]) == 0) { newGroup.add(sorted[i]); } else { cp = sorted[i]; outcomePatterns.add(newGroup); newGroup = new ArrayList(); newGroup.add(sorted[i]); } } outcomePatterns.add(newGroup); return outcomePatterns; } } --- NEW FILE: OldFormatGISModelReader.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.zip.GZIPInputStream; import opennlp.model.AbstractModelReader; import opennlp.model.Context; /** * A reader for GIS models stored in the format used in v1.0 of Maxent. It * extends the PlainTextGISModelReader to read in the info and then overrides * the getParameters method so that it can appropriately read the binary file * which stores the parameters. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public class OldFormatGISModelReader extends PlainTextGISModelReader { DataInputStream paramsInput; /** * Constructor which takes the name of the model without any suffixes, * such as ".mei.gz" or ".mep.gz". */ public OldFormatGISModelReader(String modelname) throws IOException { super(new File(modelname+".mei.gz")); paramsInput = new DataInputStream(new GZIPInputStream( new FileInputStream(modelname+".mep.gz"))); } /** * Reads the parameters from a file and populates an array of context objects. * @param outcomePatterns The outcomes patterns for the model. The first index refers to which * outcome pattern (a set of outcomes that occurs with a context) is being specified. The * second index specifies the number of contexts which use this pattern at index 0, and the * index of each outcomes which make up this pattern in indicies 1-n. * @return An array of context objects. * @throws java.io.IOException when the model file does not match the outcome patterns or can not be read. */ protected Context[] getParameters (int[][] outcomePatterns) throws java.io.IOException { Context[] params = new Context[NUM_PREDS]; int pid=0; for (int i=0; i<outcomePatterns.length; i++) { //construct outcome pattern int[] outcomePattern = new int[outcomePatterns[i].length-1]; for (int k=1; k<outcomePatterns[i].length; k++) { outcomePattern[k-1] = outcomePatterns[i][k]; } //populate parameters for each context which uses this outcome pattern. for (int j=0; j<outcomePatterns[i][0]; j++) { double[] contextParameters = new double[outcomePatterns[i].length-1]; for (int k=1; k<outcomePatterns[i].length; k++) { contextParameters[k-1] = readDouble(); } params[pid] = new Context(outcomePattern,contextParameters); pid++; } } return params; } /** * Convert a model created with Maxent 1.0 to a format used with * Maxent 1.2. * * <p>Usage: java opennlp.maxent.io.OldFormatGISModelReader model_name_prefix (new_model_name)"); * * <p>If the new_model_name is left unspecified, the new model will be saved * in gzipped, binary format as "<model_name_prefix>.bin.gz". */ public static void main (String[] args) throws IOException { if (args.length < 1) { System.out.println("Usage: java opennlp.maxent.io.OldFormatGISModelReader model_name_prefix (new_model_name)"); System.exit(0); } int nameIndex = 0; String infilePrefix = args[nameIndex]; String outfile; if (args.length > nameIndex) outfile = args[nameIndex+1]; else outfile = infilePrefix + ".bin.gz"; AbstractModelReader reader = new OldFormatGISModelReader(infilePrefix); new SuffixSensitiveGISModelWriter(reader.getModel(), new File(outfile)).persist(); } } --- NEW FILE: PooledGISModelReader.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.File; import java.io.IOException; /** * This class works exactly like the SuffisSensitiveGISModelReader except that it * attempts to pool all context strings. This is useful when loading models which * share many context strings. * */ public class PooledGISModelReader extends SuffixSensitiveGISModelReader { /** * A reader for GIS models which inspects the filename and invokes the * appropriate GISModelReader depending on the filename's suffixes. * * <p>The following assumption are made about suffixes: * <li>.gz --> the file is gzipped (must be the last suffix) * <li>.txt --> the file is plain text * <li>.bin --> the file is binary * @param f * @throws IOException */ public PooledGISModelReader(File f) throws IOException { super(f); } public String readUTF() throws IOException { return super.readUTF().intern(); } } --- NEW FILE: ObjectGISModelWriter.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.IOException; import java.io.ObjectOutputStream; import opennlp.model.AbstractModel; public class ObjectGISModelWriter extends GISModelWriter { protected ObjectOutputStream output; /** * Constructor which takes a GISModel and a ObjectOutputStream and prepares * itself to write the model to that stream. * * @param model The GISModel which is to be persisted. * @param dos The stream which will be used to persist the model. */ public ObjectGISModelWriter(AbstractModel model, ObjectOutputStream dos) { super(model); output = dos; } public void writeUTF(String s) throws IOException { output.writeUTF(s); } public void writeInt(int i) throws IOException { output.writeInt(i); } public void writeDouble(double d) throws IOException { output.writeDouble(d); } public void close() throws IOException { output.flush(); output.close(); } } --- NEW FILE: PlainTextGISModelReader.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import opennlp.model.PlainTextFileDataReader; /** * A reader for GIS models stored in plain text format. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public class PlainTextGISModelReader extends GISModelReader { /** * Constructor which directly instantiates the BufferedReader containing * the model contents. * * @param br The BufferedReader containing the model information. */ public PlainTextGISModelReader (BufferedReader br) { super(new PlainTextFileDataReader(br)); } /** * Constructor which takes a File and creates a reader for it. Detects * whether the file is gzipped or not based on whether the suffix contains * ".gz". * * @param f The File in which the model is stored. */ public PlainTextGISModelReader (File f) throws IOException { super(f); } } --- NEW FILE: SuffixSensitiveGISModelReader.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.zip.GZIPInputStream; import opennlp.model.AbstractModel; import opennlp.model.AbstractModelReader; /** * A reader for GIS models which inspects the filename and invokes the * appropriate GISModelReader depending on the filename's suffixes. * * <p>The following assumption are made about suffixes: * <li>.gz --> the file is gzipped (must be the last suffix) * <li>.txt --> the file is plain text * <li>.bin --> the file is binary * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public class SuffixSensitiveGISModelReader extends GISModelReader { protected GISModelReader suffixAppropriateReader; /** * Constructor which takes a File and invokes the GISModelReader * appropriate for the suffix. * * @param f The File in which the model is stored. */ public SuffixSensitiveGISModelReader (File f) throws IOException { super(f); } // activate this if adding another type of reader which can't read model // information in the way that the default getModel() method in // GISModelReader does. //public GISModel getModel () throws java.io.IOException { // return suffixAppropriateReader.getModel(); //} /** * To convert between different formats of the new style. * * <p>java opennlp.maxent.io.SuffixSensitiveGISModelReader old_model_name new_model_name * * <p>For example, to convert a model called "model.bin.gz" (which is thus * saved in gzipped binary format) to one in (unzipped) text format: * * <p>java opennlp.maxent.io.SuffixSensitiveGISModelReader model.bin.gz model.txt * * <p>This particular example would of course be useful when you generally * want to create models which take up less space (.bin.gz), but want to * be able to inspect a few of them as plain text files. */ public static void main(String[] args) throws IOException { AbstractModel m = new SuffixSensitiveGISModelReader(new File(args[0])).getModel(); new SuffixSensitiveGISModelWriter( m, new File(args[1])).persist(); } } --- NEW FILE: BinToAscii.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.*; import java.util.zip.*; /** * A program to convert from java binary doubles to ascii. With the new * conversion utililities provided in Maxent 1.2 this probably won't be * necessary, but it doesn't do any harm to keep it around for now. * * @author Jason Baldridge and Gann Bierner * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public class BinToAscii { public static void main(String[] args) throws IOException { PrintWriter out = new PrintWriter(new OutputStreamWriter( new GZIPOutputStream( new FileOutputStream(args[1])))); DataInputStream in = new DataInputStream(new GZIPInputStream( new FileInputStream(args[0]))); double d; try { while(true) out.println(in.readDouble()); } catch (Exception E) {} out.close(); in.close(); } } --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <!-- --> </head> <body bgcolor="white"> Provides the I/O functionality of the maxent package including reading and writting models in several formats. </body> </html> --- NEW FILE: SuffixSensitiveGISModelWriter.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.BufferedWriter; import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.zip.GZIPOutputStream; import opennlp.model.AbstractModel; /** * A writer for GIS models which inspects the filename and invokes the * appropriate GISModelWriter depending on the filename's suffixes. * * <p>The following assumption are made about suffixes: * <li>.gz --> the file is gzipped (must be the last suffix) * <li>.txt --> the file is plain text * <li>.bin --> the file is binary * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public class SuffixSensitiveGISModelWriter extends GISModelWriter { private final GISModelWriter suffixAppropriateWriter; /** * Constructor which takes a GISModel and a File and invokes the * GISModelWriter appropriate for the suffix. * * @param model The GISModel which is to be persisted. * @param f The File in which the model is to be stored. */ public SuffixSensitiveGISModelWriter (AbstractModel model, File f) throws IOException { super (model); OutputStream output; String filename = f.getName(); // handle the zipped/not zipped distinction if (filename.endsWith(".gz")) { output = new GZIPOutputStream(new FileOutputStream(f)); filename = filename.substring(0,filename.length()-3); } else { output = new DataOutputStream(new FileOutputStream(f)); } // handle the different formats if (filename.endsWith(".bin")) { suffixAppropriateWriter = new BinaryGISModelWriter(model, new DataOutputStream(output)); } else { // default is ".txt" suffixAppropriateWriter = new PlainTextGISModelWriter(model, new BufferedWriter(new OutputStreamWriter(output))); } } public void writeUTF (String s) throws java.io.IOException { suffixAppropriateWriter.writeUTF(s); } public void writeInt (int i) throws java.io.IOException { suffixAppropriateWriter.writeInt(i); } public void writeDouble (double d) throws java.io.IOException { suffixAppropriateWriter.writeDouble(d); } public void close () throws java.io.IOException { suffixAppropriateWriter.close(); } } --- NEW FILE: GISModelReader.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent.io; import java.io.File; import java.io.IOException; import opennlp.maxent.GISModel; import opennlp.model.AbstractModel; import opennlp.model.AbstractModelReader; import opennlp.model.Context; import opennlp.model.DataReader; /** * Abstract parent class for readers of GISModels. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:33 $ */ public class GISModelReader extends AbstractModelReader { public GISModelReader(File file) throws IOException { super(file); } public GISModelReader(DataReader dataReader) { super(dataReader); } /** * Retrieve a model from disk. It assumes that models are saved in the * following sequence: * * <br>GIS (model type identifier) * <br>1. # of parameters (int) * <br>2. the correction constant (int) * <br>3. the correction constant parameter (double) * <br>4. # of outcomes (int) * <br> * list of outcome names (String) * <br>5. # of different types of outcome patterns (int) * <br> * list of (int int[]) * <br> [# of predicates for which outcome pattern is true] [outcome pattern] * <br>6. # of predicates (int) * <br> * list of predicate names (String) * * <p>If you are creating a reader for a format which won't work with this * (perhaps a database or xml file), override this method and ignore the * other methods provided in this abstract class. * * @return The GISModel stored in the format and location specified to * this GISModelReader (usually via its the constructor). */ public AbstractModel constructModel() throws IOException { int correctionConstant = getCorrectionConstant(); double correctionParam = getCorrectionParameter(); String[] outcomeLabels = getOutcomes(); int[][] outcomePatterns = getOutcomePatterns(); String[] predLabels = getPredicates(); Context[] params = getParameters(outcomePatterns); return new GISModel(params, predLabels, outcomeLabels, correctionConstant, correctionParam); } public void checkModelType() throws java.io.IOException { String modelType = readUTF(); if (!modelType.equals("GIS")) System.out.println("Error: attempting to load a "+modelType+ " model as a GIS model."+ " You should expect problems."); } protected int getCorrectionConstant() throws java.io.IOException { return readInt(); } protected double getCorrectionParameter() throws java.io.IOException { return readDouble(); } } |
Update of /cvsroot/maxent/maxent/src/java/opennlp/model In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/java/opennlp/model Removed Files: ObjectDataReader.java EventCollectorAsStream.java DynamicEvalParameters.java Event.java AbstractModelReader.java AbstractModelWriter.java Context.java OnePassRealValueDataIndexer.java UniformPrior.java PlainTextFileDataReader.java EvalParameters.java MaxentModel.java RealValueFileEventStream.java GenericModelWriter.java FileEventStream.java EventCollector.java GenericModelReader.java DataReader.java EventStream.java AbstractDataIndexer.java AbstractModel.java AbstractEventStream.java TwoPassDataIndexer.java ComparablePredicate.java DataIndexer.java OnePassDataIndexer.java ComparableEvent.java BinaryFileDataReader.java Prior.java MutableContext.java Log Message: Introduced maven build. --- ObjectDataReader.java DELETED --- --- EventCollectorAsStream.java DELETED --- --- DynamicEvalParameters.java DELETED --- --- Event.java DELETED --- --- AbstractModelReader.java DELETED --- --- AbstractModelWriter.java DELETED --- --- Context.java DELETED --- --- OnePassRealValueDataIndexer.java DELETED --- --- UniformPrior.java DELETED --- --- PlainTextFileDataReader.java DELETED --- --- EvalParameters.java DELETED --- --- MaxentModel.java DELETED --- --- RealValueFileEventStream.java DELETED --- --- GenericModelWriter.java DELETED --- --- FileEventStream.java DELETED --- --- EventCollector.java DELETED --- --- GenericModelReader.java DELETED --- --- DataReader.java DELETED --- --- EventStream.java DELETED --- --- AbstractDataIndexer.java DELETED --- --- AbstractModel.java DELETED --- --- AbstractEventStream.java DELETED --- --- TwoPassDataIndexer.java DELETED --- --- ComparablePredicate.java DELETED --- --- DataIndexer.java DELETED --- --- OnePassDataIndexer.java DELETED --- --- ComparableEvent.java DELETED --- --- BinaryFileDataReader.java DELETED --- --- Prior.java DELETED --- --- MutableContext.java DELETED --- |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:41
|
Update of /cvsroot/maxent/maxent/src/java/opennlp/perceptron In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/java/opennlp/perceptron Removed Files: PerceptronModel.java BinaryPerceptronModelReader.java BinaryPerceptronModelWriter.java PlainTextPerceptronModelWriter.java PerceptronTrainer.java PlainTextPerceptronModelReader.java PerceptronModelReader.java PerceptronModelWriter.java SuffixSensitivePerceptronModelWriter.java Log Message: Introduced maven build. --- PerceptronModel.java DELETED --- --- BinaryPerceptronModelReader.java DELETED --- --- BinaryPerceptronModelWriter.java DELETED --- --- PlainTextPerceptronModelWriter.java DELETED --- --- PerceptronTrainer.java DELETED --- --- PlainTextPerceptronModelReader.java DELETED --- --- PerceptronModelReader.java DELETED --- --- PerceptronModelWriter.java DELETED --- --- SuffixSensitivePerceptronModelWriter.java DELETED --- |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:41
|
Update of /cvsroot/maxent/maxent/src/main/java/opennlp In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20839/src/main/java/opennlp Log Message: Directory /cvsroot/maxent/maxent/src/main/java/opennlp added to the repository |
Update of /cvsroot/maxent/maxent/src/main/java/opennlp/maxent In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/main/java/opennlp/maxent Added Files: DomainToModelMap.java package.html BasicContextGenerator.java AllEnglishAffixes.txt IntegerPool.java Evalable.java RealBasicEventStream.java BasicEventStream.java GISFormat DataStream.java ContextGenerator.java ModelReplacementManager.java ModelSetter.java TrainEval.java BinToAscii.java GIS.java Main.java PlainTextByLineDataStream.java ModelDomain.java GISModel.java Counter.java GISTrainer.java Log Message: Introduced maven build. --- NEW FILE: DomainToModelMap.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import java.util.*; import opennlp.model.MaxentModel; /** * A class which stores a mapping from ModelDomain objects to MaxentModels. * This permits an application to replace an old model for a domain with a * newly trained one in a thread-safe manner. By calling the getModel() * method, the application can create new instances of classes which use the * relevant models. * * @author Jason Baldridge and Eric Friedman * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public class DomainToModelMap { // the underlying object which stores the mapping private Map map = Collections.synchronizedMap(new HashMap()); /** * Sets the model for the given domain. * * @param domain The ModelDomain object which keys to the model. * @param model The MaxentModel trained for the domain. */ public void setModelForDomain (ModelDomain domain, MaxentModel model) { map.put(domain, model); } /** * Get the model mapped to by the given ModelDomain key. * * @param domain The ModelDomain object which keys to the desired model. * @return The MaxentModel corresponding to the given domain. */ public MaxentModel getModel (ModelDomain domain) { if (map.containsKey(domain)) { return (MaxentModel)map.get(domain); } else { throw new NoSuchElementException("No model has been created for "+ "domain: " + domain); } } /** * Removes the mapping for this ModelDomain key from this map if present. * * @param domain The ModelDomain key whose mapping is to be removed from * the map. */ public void removeDomain (ModelDomain domain) { map.remove(domain); } /** * A set view of the ModelDomain keys contained in this map. * * @return a set view of the ModelDomain keys contained in this map */ public Set keySet () { return map.keySet(); } } --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <!-- --> </head> <body bgcolor="white"> Provides main functionality of the maxent package including data structures and algorithms for parameter estimation. </body> </html> --- NEW FILE: BasicContextGenerator.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import java.util.*; /** * Generate contexts for maxent decisions, assuming that the input * given to the getContext() method is a String containing contextual * predicates separated by spaces. * e.g: * <p> * cp_1 cp_2 ... cp_n * </p> * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public class BasicContextGenerator implements ContextGenerator { /** * Builds up the list of contextual predicates given a String. */ public String[] getContext(Object o) { String s = (String) o; return (String[]) s.split(" "); } } --- NEW FILE: AllEnglishAffixes.txt --- -'s -able -acea -aceae -aceous -ad -ade -aemia -age -agogue -al -ales -algia -amine -an -ana -ance -ancy -and -androus -andry -ane -ant -ar -arch -archy -ard -arian -arium -art -ary -ase -asis -aster -ate -atic -ation -ative -ator -atory -bashing -biosis -blast -bodied -branch -cade -carp -carpic -carpous -cele -cene -centric -cephalic -cephalus -chore -chrome -chroous -cide -clase -cle -cline -colous -cracy -crat -cule -cy -cyst -cyte -decker -derm -diene -dom -drome -dromous -ean -ectomy -ed -ee -eer -eme -emia -en -ence -enchyma -ency -ene -ent -eous -er -ery -es -escent -ese -esque -ess -est -et -eth -ette -ey -facient -favoured -featured -fer -ferous -fic -fid -florous -fold -footed -form -free -fuge -ful -fy -gaited -gamy -gen -gene -genesis -genic -genous -geny -gerous -gnathous -gnosis -gon -gonium -gony -grade -gram -graph -grapher -graphy -gynous -haemia -haired -handed -hearted -hedron -hemia -hood -i -i- -ia -ial -ian -iana -iasis -iatrics -iatry -ible -ic -ical -ician -ics -id -idae -ide -ie -ier -ify -ile -in -inae -ine -ing -ion -ious -ise -ish -ism -ist -istic -ite -itis -itol -ity -ium -ive -ize -ji -kin -lalia -lashed -latry -lepsy -less -let -like -ling -lipped -lite -lith -lithic -lived -log -logue -logy -ly -lysis -lyte -lytic -mancy -mania -mantic -mas -masted -ment -mer -mere -merous -meter -metry -mo -morph -most -motored -mycete -n't -nasty -naut -ness -nik -nomy -o -o- -ock -ode -odont -oid -oidea -ol -ole -oma -ome -on -one -onym -opia -opsis -or -ory -ose -osis -otic -our -ous -parous -path -pathy -ped -pede -person -petal -phage -phagy -phane -phany -phasia -phile -philia -philous -phobe -phobia -phone -phony -phore -phoresis -phyll -phyllous -phyte -plasia -plasm -plast -plastic -plasty -plegia -ploid -pod -podium -podous -poiesis -pounder -prone -proof -pterous -rhoea -rigged -rrhagia -rrhoea -ry -s -s' -saur -scape -scope -scopy -sect -sepalous -shaped -ship -sided -some -sophy -sperm -sphere -sporous -st -stat -ster -stichous -stome -stomous -stomy -stress -tactic -taxis -taxy -termer -th -thermy -thymia -tion -to-be -tome -tomy -trix -tron -trope -trophy -tropic -tropism -tropous -tude -ty -type -ule -ulent -ure -uret -urgy -uria -ville -visaged -vorous -ward -wards -ways -wise -witted -y -yl -yne -zoa -zoon --- NEW FILE: IntegerPool.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; /** * A pool of read-only, unsigned Integer objects within a fixed, * non-sparse range. Use this class for operations in which a large * number of Integer wrapper objects will be created. * * Created: Sat Oct 27 10:59:11 2001 * * @author Eric Friedman * @version $Id: IntegerPool.java,v 1.1 2009/01/22 23:23:34 joernkottmann Exp $ */ public class IntegerPool { private Integer[] _table; /** * Creates an IntegerPool with 0..size Integer objects. * * @param size the size of the pool. */ public IntegerPool (int size) { _table = new Integer[size]; for (int i = 0; i < size; i++) { _table[i] = new Integer(i); } // end of for (int i = 0; i < size; i++) } /** * Returns the shared Integer wrapper for <tt>value</tt> if it is * inside the range managed by this pool. if <tt>value</tt> is * outside the range, a new Integer instance is returned. * * @param value an <code>int</code> value * @return an <code>Integer</code> value */ public Integer get(int value) { if (value < _table.length && value >= 0) { return _table[value]; } else { return new Integer(value); } } }// IntegerPool --- NEW FILE: Evalable.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import java.io.*; import opennlp.model.EventCollector; import opennlp.model.MaxentModel; /** * Interface for components which use maximum entropy models and can evaluate * the performace of the models using the TrainEval class. * * @author Gann Bierner * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public interface Evalable { /** * The outcome that should be considered a negative result. This is used * for computing recall. In the case of binary decisions, this would be * the false one. * * @return the events that this EventCollector has gathered */ public String getNegativeOutcome(); /** * Returns the EventCollector that is used to collect all relevant * information from the data file. This is used for to test the * predictions of the model. Note that if some of your features are the * oucomes of previous events, this method will give you results assuming * 100% performance on the previous events. If you don't like this, use * the localEval method. * * @param r A reader containing the data for the event collector * @return an EventCollector */ public EventCollector getEventCollector(Reader r); /** * If the -l option is selected for evaluation, this method will be * called rather than TrainEval's evaluation method. This is good if * your features includes the outcomes of previous events. * * @param model the maxent model to evaluate * @param r Reader containing the data to process * @param e The original Evalable. Probably not relevant. * @param verbose a request to print more specific processing information */ public void localEval(MaxentModel model, Reader r, Evalable e, boolean verbose); } --- NEW FILE: RealBasicEventStream.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import opennlp.model.AbstractEventStream; import opennlp.model.Event; import opennlp.model.EventStream; import opennlp.model.RealValueFileEventStream; public class RealBasicEventStream extends AbstractEventStream { ContextGenerator cg = new BasicContextGenerator(); DataStream ds; Event next; public RealBasicEventStream(DataStream ds) { this.ds = ds; if (this.ds.hasNext()) next = createEvent((String)this.ds.nextToken()); } public Event next() { while (next == null && this.ds.hasNext()) next = createEvent((String)this.ds.nextToken()); Event current = next; if (this.ds.hasNext()) { next = createEvent((String)this.ds.nextToken()); } else { next = null; } return current; } public boolean hasNext() { while (next == null && ds.hasNext()) next = createEvent((String)ds.nextToken()); return next != null; } private Event createEvent(String obs) { int lastSpace = obs.lastIndexOf(' '); if (lastSpace == -1) return null; else { String[] contexts = obs.substring(0,lastSpace).split("\\s+"); float[] values = RealValueFileEventStream.parseContexts(contexts); return new Event(obs.substring(lastSpace+1),contexts,values); } } public static void main(String[] args) throws java.io.IOException { EventStream es = new RealBasicEventStream(new PlainTextByLineDataStream(new java.io.FileReader(args[0]))); while (es.hasNext()) { System.out.println(es.next()); } } } --- NEW FILE: BasicEventStream.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import opennlp.model.AbstractEventStream; import opennlp.model.Event; /** * A object which can deliver a stream of training events assuming * that each event is represented as a space separated list containing * all the contextual predicates, with the last item being the * outcome. * e.g.: * * <p> cp_1 cp_2 ... cp_n outcome * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public class BasicEventStream extends AbstractEventStream { ContextGenerator cg = new BasicContextGenerator(); DataStream ds; Event next; public BasicEventStream (DataStream ds) { this.ds = ds; if (this.ds.hasNext()) next = createEvent((String)this.ds.nextToken()); } /** * Returns the next Event object held in this EventStream. Each call to nextEvent advances the EventStream. * * @return the Event object which is next in this EventStream */ public Event next () { while (next == null && this.ds.hasNext()) next = createEvent((String)this.ds.nextToken()); Event current = next; if (this.ds.hasNext()) { next = createEvent((String)this.ds.nextToken()); } else { next = null; } return current; } /** * Test whether there are any Events remaining in this EventStream. * * @return true if this EventStream has more Events */ public boolean hasNext () { while (next == null && ds.hasNext()) next = createEvent((String)ds.nextToken()); return next != null; } private Event createEvent(String obs) { int lastSpace = obs.lastIndexOf(' '); if (lastSpace == -1) return null; else return new Event(obs.substring(lastSpace+1), cg.getContext(obs.substring(0, lastSpace))); } } --- NEW FILE: GISFormat --- Format for the GIS maxent info (.mei) files. GIS (model type identifier) 1. # of parameters (int) 2. the correction constant (int) 3. the correction constant parameter (double) 4. # of outcomes (int) * list of outcome names (String) 5. # of different types of outcome patterns (int) * list of (int int[]) [# of predicates for which outcome pattern is true] [outcome pattern] 6. # of predicates (int) * list of predicate names (String) --- NEW FILE: DataStream.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; /** * A interface for objects which can deliver a stream of training data to be * supplied to an EventStream. It is not necessary to use a DataStream in a * Maxent application, but it can be used to support a wider variety of formats * in which your training data can be held. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public interface DataStream { /** * Returns the next slice of data held in this DataStream. * * @return the Object representing the data which is next in this * DataStream */ public Object nextToken (); /** * Test whether there are any Events remaining in this EventStream. * * @return true if this DataStream has more data tokens */ public boolean hasNext (); } --- NEW FILE: ContextGenerator.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; /** * Generate contexts for maxent decisions. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ * */ public interface ContextGenerator { /** * Builds up the list of contextual predicates given an Object. */ public String[] getContext(Object o); } --- NEW FILE: ModelReplacementManager.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import opennlp.model.MaxentModel; /** * A object which can be used to ensure that a Maxent application can swap the * model currently in use with a new one in a thread-safe manner without * stopping the servicing of requests. Use this if your maxent application is * a heavy-weight one or you have only one particular MaxentModel to use with * your application. If your application class is lightweight and you will be * creating multiple instances of it with different underlying models, consider * using a DomainToModelMap object to ensure thread-safe model swapping. * * <p>For example, in your application, create a ModelReplacementManager as * follows: * * <pre> * private final ModelReplacementManager replacementManager = * new ModelReplacementManager( * new ModelSetter() { * public void setModel(MaxentModel m) { * model = m; * } * } * ); * </pre> * * where "model" would be the actual variable name of the model used by your * application which you wish to be able to swap (you might have other models * which need their own ModelReplacementManager). * * <p>You'll also need a method to swap the model which calls the manager's * replaceModel(MaxentModel m) method, e.g., * * <pre> * public void replaceModel (MaxentModel newmod) { * replacementManager.replaceModel(newmod); * } * </pre> * * Then, in the code that uses the model, you need to inform the * ModelReplacementManager when a thread is beginning to use the model and when * it no longer needs to be sure that the same model is being used. For * example, it is quite common to evaluate a particular context, get back a * double[] which has the normalized probabilities of each of the outcomes given * that context, and then request the name of a particular outcome. The model * cannot be swapped during that time since the mapping from outcome labels to * unique will (probably) be different between the different models. So, do as * follows: * * <pre> * replacementManager.startUsingModel(); * // some code which evaluates the context, e.g., * double[] probs = model.eval(someContext); * // some code which returns a particular outcome * if (model.getBestOutcome(probs).equals("T") ... * replacementManager.finishUsingModel(); * </pre> * * The manager will then make sure that all requests which are currently being * serviced are completed before the new model is swapped in. New requests * which are made while the models are being swapped are forced to wait for the * swap to finish. These requests will then be serviced by the new model. * * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public class ModelReplacementManager { private ModelSetter setter; private int users = 0; private boolean replacementCanProceed = true; private Thread replacementThread = null; public ModelReplacementManager (ModelSetter ms) { setter = ms; } /** * Inform the manager that a thread is using the model. If a replacement * is underway, the thread is forced to join the replacement thread and thus * wait until it is finished to begin using the model. */ public void startUsingModel () { if (replacementThread != null) { try { replacementThread.join(); } catch (InterruptedException e) {} } replacementCanProceed = false; users++; } /** * Inform the manager that a thread is done using the model, and thus is * not dependending on it being unchanged. */ public void finishUsingModel () { users--; if (users<=0) replacementCanProceed = true; } /** * Replace the old model with a new one, forcing the replacement to wait * until all threads using the old model have finished using it. * * @param model The new model which is being swapped in. */ public synchronized void replaceModel (MaxentModel model) { replacementThread = Thread.currentThread(); while (!replacementCanProceed) Thread.yield(); setter.setModel(model); replacementThread = null; } } --- NEW FILE: ModelSetter.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import opennlp.model.MaxentModel; /** * A object to facilitate the resetting of a MaxentModel variable to a * new value (model). In general this will be used anonymously, for example, as * follows: * <p> * <pre> * private final ModelReplacementManager replacementManager = * new ModelReplacementManager( * new ModelSetter() { * public void setModel(MaxentModel m) { * model = m; * } * } * ); * </pre> * <p> * where "model" would be the actual variable name of the model used by your * application which you wish to be able to swap (you might have other models * which need their own ModelSetters). * * <p> * Basically, this is just a clean way of giving a ModelReplacementManager * access to a private variable holding the model. Nothing complex here. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public interface ModelSetter { /** * Assign a new MaxentModel value to a MaxentModel variable. * * @param m The new model. */ public void setModel (MaxentModel m); } --- NEW FILE: TrainEval.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.Reader; import opennlp.maxent.io.SuffixSensitiveGISModelReader; import opennlp.maxent.io.SuffixSensitiveGISModelWriter; import opennlp.model.AbstractModel; import opennlp.model.Event; import opennlp.model.EventCollectorAsStream; import opennlp.model.EventStream; import opennlp.model.MaxentModel; /** * Trains or evaluates maxent components which have implemented the Evalable * interface. * * @author Gann Bierner * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public class TrainEval { public static void eval(MaxentModel model, Reader r, Evalable e) { eval(model, r, e, false); } public static void eval(MaxentModel model, Reader r, Evalable e, boolean verbose) { float totPos=0, truePos=0, falsePos=0; Event[] events = (e.getEventCollector(r)).getEvents(true); //MaxentModel model = e.getModel(dir, name); String negOutcome = e.getNegativeOutcome(); for(int i=0; i<events.length; i++) { String guess = model.getBestOutcome(model.eval(events[i].getContext())); String ans = events[i].getOutcome(); if(verbose) System.out.println(ans + " " + guess); if(!ans.equals(negOutcome)) totPos++; if(!guess.equals(negOutcome) && !guess.equals(ans)) falsePos++; else if(ans.equals(guess)) truePos++; } System.out.println("Precision: " + truePos/(truePos+falsePos)); System.out.println("Recall: " + truePos/totPos); } public static MaxentModel train(EventStream events, int cutoff) { return GIS.trainModel(events, 100, cutoff); } public static void run(String[] args, Evalable e) throws IOException { // TOM: Was commented out to remove dependency on gnu getopt. // String dir = "./"; // String stem = "maxent"; // int cutoff = 0; // default to no cutoff // boolean train = false; // boolean verbose = false; // boolean local = false; // gnu.getopt.Getopt g = // new gnu.getopt.Getopt("maxent", args, "d:s:c:tvl"); // int c; // while ((c = g.getopt()) != -1) { // switch(c) { // case 'd': // dir = g.getOptarg()+"/"; // break; // case 's': // stem = g.getOptarg(); // break; // case 'c': // cutoff = Integer.parseInt(g.getOptarg()); // break; // case 't': // train = true; // break; // case 'l': // local = true; // break; // case 'v': // verbose = true; // break; // } // } // // int lastIndex = g.getOptind(); // if (lastIndex >= args.length) { // System.out.println("This is a usage message from opennlp.maxent.TrainEval. You have called the training procedure for a maxent application with the incorrect arguments. These are the options:"); // // System.out.println("\nOptions for defining the model location and name:"); // System.out.println(" -d <directoryName>"); // System.out.println("\tThe directory in which to store the model."); // System.out.println(" -s <modelName>"); // System.out.println("\tThe name of the model, e.g. EnglishPOS.bin.gz or NameFinder.txt."); // // System.out.println("\nOptions for training:"); // System.out.println(" -c <cutoff>"); // System.out.println("\tAn integer cutoff level to reduce infrequent contextual predicates."); // System.out.println(" -t\tTrain a model. If absent, the given model will be loaded and evaluated."); // System.out.println("\nOptions for evaluation:"); // System.out.println(" -l\t the evaluation method of class that uses the model. If absent, TrainEval's eval method is used."); // System.out.println(" -v\t verbose."); // System.out.println("\nThe final argument is the data file to be loaded and used for either training or evaluation."); // System.out.println("\nAs an example for training:\n java opennlp.grok.preprocess.postag.POSTaggerME -t -d ./ -s EnglishPOS.bin.gz -c 7 postag.data"); // System.exit(0); // } // // FileReader datafr = new FileReader(args[lastIndex]); // // if (train) { // MaxentModel m = // train(new EventCollectorAsStream(e.getEventCollector(datafr)), // cutoff); // new SuffixSensitiveGISModelWriter((AbstractModel)m, // new File(dir+stem)).persist(); // } // else { // MaxentModel model = // new SuffixSensitiveGISModelReader(new File(dir+stem)).getModel(); // if (local) { // e.localEval(model, datafr, e, verbose); // } else { // eval(model, datafr, e, verbose); // } // } } } --- NEW FILE: BinToAscii.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import java.io.*; import java.util.zip.*; /** * A program to convert from java binary doubles to ascii * * @author Jason Baldridge and Gann Bierner * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public class BinToAscii { public static void main(String[] args) throws IOException { PrintWriter out = new PrintWriter(new OutputStreamWriter( new GZIPOutputStream( new FileOutputStream(args[1])))); DataInputStream in = new DataInputStream(new GZIPInputStream( new FileInputStream(args[0]))); double d; try { while(true) out.println(in.readDouble()); } catch (Exception E) {} out.close(); in.close(); } } --- NEW FILE: GIS.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import opennlp.model.AbstractModel; import opennlp.model.DataIndexer; import opennlp.model.EventStream; import opennlp.model.Prior; /** * A Factory class which uses instances of GISTrainer to create and train * GISModels. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public class GIS { /** * Set this to false if you don't want messages about the progress of * model training displayed. Alternately, you can use the overloaded * version of trainModel() to conditionally enable progress messages. */ public static boolean PRINT_MESSAGES = true; /** If we are using smoothing, this is used as the "number" of * times we want the trainer to imagine that it saw a feature that it * actually didn't see. Defaulted to 0.1. */ public static double SMOOTHING_OBSERVATION = 0.1; /** * Train a model using the GIS algorithm, assuming 100 iterations and no * cutoff. * * @param eventStream The EventStream holding the data on which this model * will be trained. * @return The newly trained model, which can be used immediately or saved * to disk using an opennlp.maxent.io.GISModelWriter object. */ public static GISModel trainModel(EventStream eventStream) { return trainModel(eventStream, 100, 0, false, PRINT_MESSAGES); } /** * Train a model using the GIS algorithm, assuming 100 iterations and no * cutoff. * * @param eventStream The EventStream holding the data on which this model * will be trained. * @param smoothing Defines whether the created trainer will use smoothing * while training the model. * @return The newly trained model, which can be used immediately or saved * to disk using an opennlp.maxent.io.GISModelWriter object. */ public static GISModel trainModel(EventStream eventStream, boolean smoothing) { return trainModel(eventStream, 100, 0, smoothing,PRINT_MESSAGES); } /** * Train a model using the GIS algorithm. * * @param eventStream The EventStream holding the data on which this model * will be trained. * @param iterations The number of GIS iterations to perform. * @param cutoff The number of times a feature must be seen in order * to be relevant for training. * @return The newly trained model, which can be used immediately or saved * to disk using an opennlp.maxent.io.GISModelWriter object. */ public static GISModel trainModel(EventStream eventStream, int iterations, int cutoff) { return trainModel(eventStream, iterations, cutoff, false,PRINT_MESSAGES); } /** * Train a model using the GIS algorithm. * @param eventStream The EventStream holding the data on which this model * will be trained. * @param iterations The number of GIS iterations to perform. * @param cutoff The number of times a feature must be seen in order * to be relevant for training. * @param smoothing Defines whether the created trainer will use smoothing * while training the model. * @param printMessagesWhileTraining Determines whether training status messages are written to STDOUT. * @return The newly trained model, which can be used immediately or saved * to disk using an opennlp.maxent.io.GISModelWriter object. */ public static GISModel trainModel(EventStream eventStream, int iterations, int cutoff, boolean smoothing,boolean printMessagesWhileTraining) { GISTrainer trainer = new GISTrainer(printMessagesWhileTraining); trainer.setSmoothing(smoothing); trainer.setSmoothingObservation(SMOOTHING_OBSERVATION); return trainer.trainModel(eventStream, iterations, cutoff); } /** * Train a model using the GIS algorithm. * @param iterations The number of GIS iterations to perform. * @param indexer The object which will be used for event compilation. * @param smoothing Defines whether the created trainer will use smoothing while training the model. * @return The newly trained model, which can be used immediately or saved * to disk using an opennlp.maxent.io.GISModelWriter object. */ public static GISModel trainModel(int iterations, DataIndexer indexer, boolean smoothing) { return trainModel(iterations,indexer,true,smoothing,null,0); } /** * Train a model using the GIS algorithm. * @param iterations The number of GIS iterations to perform. * @param indexer The object which will be used for event compilation. * @return The newly trained model, which can be used immediately or saved * to disk using an opennlp.maxent.io.GISModelWriter object. */ public static GISModel trainModel(int iterations, DataIndexer indexer) { return trainModel(iterations,indexer,true,false,null,0); } /** * Train a model using the GIS algorithm with the specified number of iterations, data indexer, and prior. * @param iterations The number of GIS iterations to perform. * @param indexer The object which will be used for event compilation. * @param modelPrior The prior distribution for the model. * @return The newly trained model, which can be used immediately or saved * to disk using an opennlp.maxent.io.GISModelWriter object. */ public static GISModel trainModel(int iterations, DataIndexer indexer, Prior modelPrior, int cutoff) { return trainModel(iterations,indexer,true,false,modelPrior,cutoff); } /** * Train a model using the GIS algorithm. * @param iterations The number of GIS iterations to perform. * @param indexer The object which will be used for event compilation. * @param printMessagesWhileTraining Determines whether training status messages are written to STDOUT. * @param smoothing Defines whether the created trainer will use smoothing while training the model. * @param modelPrior The prior distribution for the model. * @param cutoff The number of times a predicate must occur to be used in a model. * @return The newly trained model, which can be used immediately or saved * to disk using an opennlp.maxent.io.GISModelWriter object. */ public static GISModel trainModel(int iterations, DataIndexer indexer, boolean printMessagesWhileTraining, boolean smoothing, Prior modelPrior, int cutoff) { GISTrainer trainer = new GISTrainer(printMessagesWhileTraining); trainer.setSmoothing(smoothing); trainer.setSmoothingObservation(SMOOTHING_OBSERVATION); if (modelPrior != null) { return trainer.trainModel(iterations, indexer, modelPrior,cutoff); } else { return trainer.trainModel(iterations, indexer,0); } } } --- NEW FILE: Main.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; /** * Main file for opennlp.maxent. Right now just tells the user that * the executable jar doesn't actually execute anything but the * message telling the user that the jar doesn't execute anything * but... * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public class Main { public static void main (String[] args) { System.out.println( "\n********************************************************************\n" + "The \"executable\" jar of OpenNLP Maxent does not currently execute\n" + "anything except this message. It exists only so that there is a jar\n" + "of the package which contains all of the other jar dependencies\n" + "needed by Maxent so that users can download it and be able to use\n" + "it to build maxent applications without hunting down the other jars.\n" + "********************************************************************\n" ); } } --- NEW FILE: PlainTextByLineDataStream.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import java.io.*; /** * This DataStream implementation will take care of reading a plain text file * and returning the Strings between each new line character, which is what * many Maxent applications need in order to create EventStreams. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ * */ public class PlainTextByLineDataStream implements DataStream { BufferedReader dataReader; String next; public PlainTextByLineDataStream (Reader dataSource) { dataReader = new BufferedReader(dataSource); try { next = dataReader.readLine(); } catch (IOException e) { e.printStackTrace(); } } public Object nextToken () { String current = next; try { next = dataReader.readLine(); } catch (Exception e) { e.printStackTrace(); } return current; } public boolean hasNext () { return next != null; } } --- NEW FILE: ModelDomain.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; /** * A simple interface that represents a domain to which a particular maxent * model is primarily applicable. For instance, one might have a * part-of-speech tagger trained on financial text and another based on * children's stories. This interface is used by the DomainToModelMap class * to allow an application to grab the models relevant for the different * domains. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public interface ModelDomain { /** * Get the name of this domain. * * @return The name of this domain. */ public String getName (); } --- NEW FILE: GISModel.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import java.io.BufferedReader; import java.io.File; import java.io.InputStreamReader; import java.text.DecimalFormat; import opennlp.model.AbstractModel; import opennlp.model.Context; import opennlp.model.EvalParameters; import opennlp.model.Prior; import opennlp.model.UniformPrior; /** * A maximum entropy model which has been trained using the Generalized * Iterative Scaling procedure (implemented in GIS.java). * * @author Tom Morton and Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public final class GISModel extends AbstractModel { /** * Creates a new model with the specified parameters, outcome names, and predicate/feature labels. * @param params The parameters of the model. * @param predLabels The names of the predicates used in this model. * @param outcomeNames The names of the outcomes this model predicts. * @param correctionConstant The maximum number of active features which occur in an event. * @param correctionParam The parameter associated with the correction feature. */ public GISModel (Context[] params, String[] predLabels, String[] outcomeNames, int correctionConstant, double correctionParam) { this(params,predLabels,outcomeNames,correctionConstant,correctionParam, new UniformPrior()); } /** * Creates a new model with the specified parameters, outcome names, and predicate/feature labels. * @param params The parameters of the model. * @param predLabels The names of the predicates used in this model. * @param outcomeNames The names of the outcomes this model predicts. * @param correctionConstant The maximum number of active features which occur in an event. * @param correctionParam The parameter associated with the correction feature. * @param prior The prior to be used with this model. */ public GISModel (Context[] params, String[] predLabels, String[] outcomeNames, int correctionConstant,double correctionParam, Prior prior) { super(params,predLabels,outcomeNames,correctionConstant,correctionParam); this.prior = prior; prior.setLabels(ocNames, predLabels); modelType = ModelType.Maxent; } /** * Use this model to evaluate a context and return an array of the * likelihood of each outcome given that context. * * @param context The names of the predicates which have been observed at * the present decision point. * @return The normalized probabilities for the outcomes given the * context. The indexes of the double[] are the outcome * ids, and the actual string representation of the * outcomes can be obtained from the method * getOutcome(int i). */ public final double[] eval(String[] context) { return(eval(context,new double[evalParams.getNumOutcomes()])); } public final double[] eval(String[] context, float[] values) { return(eval(context,values,new double[evalParams.getNumOutcomes()])); } public final double[] eval(String[] context, double[] outsums) { return eval(context,null,outsums); } /** * Use this model to evaluate a context and return an array of the * likelihood of each outcome given that context. * * @param context The names of the predicates which have been observed at * the present decision point. * @param outsums This is where the distribution is stored. * @return The normalized probabilities for the outcomes given the * context. The indexes of the double[] are the outcome * ids, and the actual string representation of the * outcomes can be obtained from the method * getOutcome(int i). */ public final double[] eval(String[] context, float[] values, double[] outsums) { int[] scontexts = new int[context.length]; for (int i=0; i<context.length; i++) { Integer ci = pmap.get(context[i]); scontexts[i] = ci == null ? -1 : ci; } prior.logPrior(outsums, scontexts,values); return GISModel.eval(scontexts,values,outsums,evalParams); } /** * Use this model to evaluate a context and return an array of the * likelihood of each outcome given the specified context and the specified parameters. * @param context The integer values of the predicates which have been observed at * the present decision point. * @param prior The prior distribution for the specified context. * @param model The set of parametes used in this computation. * @return The normalized probabilities for the outcomes given the * context. The indexes of the double[] are the outcome * ids, and the actual string representation of the * outcomes can be obtained from the method * getOutcome(int i). */ public static double[] eval(int[] context, double[] prior, EvalParameters model) { return eval(context,null,prior,model); } /** * Use this model to evaluate a context and return an array of the * likelihood of each outcome given the specified context and the specified parameters. * @param context The integer values of the predicates which have been observed at * the present decision point. * @param values The values for each of the parameters. * @param prior The prior distribution for the specified context. * @param model The set of parametes used in this computation. * @return The normalized probabilities for the outcomes given the * context. The indexes of the double[] are the outcome * ids, and the actual string representation of the * outcomes can be obtained from the method * getOutcome(int i). */ public static double[] eval(int[] context, float[] values, double[] prior, EvalParameters model) { Context[] params = model.getParams(); int numfeats[] = new int[model.getNumOutcomes()]; int[] activeOutcomes; double[] activeParameters; double value = 1; for (int ci = 0; ci < context.length; ci++) { if (context[ci] >= 0) { Context predParams = params[context[ci]]; activeOutcomes = predParams.getOutcomes(); activeParameters = predParams.getParameters(); if (values != null) { value = values[ci]; } for (int ai = 0; ai < activeOutcomes.length; ai++) { int oid = activeOutcomes[ai]; numfeats[oid]++; prior[oid] += activeParameters[ai] * value; } } } double normal = 0.0; for (int oid = 0; oid < model.getNumOutcomes(); oid++) { if (model.getCorrectionParam() != 0) { prior[oid] = Math.exp(prior[oid]*model.getConstantInverse()+((1.0 - ((double) numfeats[oid] / model.getCorrectionConstant())) * model.getCorrectionParam())); } else { prior[oid] = Math.exp(prior[oid]*model.getConstantInverse()); } normal += prior[oid]; } for (int oid = 0; oid < model.getNumOutcomes(); oid++) { prior[oid] /= normal; } return prior; } public static void main(String[] args) throws java.io.IOException { if (args.length == 0) { System.err.println("Usage: GISModel modelname < contexts"); System.exit(1); } AbstractModel m = new opennlp.maxent.io.SuffixSensitiveGISModelReader(new File(args[0])).getModel(); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); DecimalFormat df = new java.text.DecimalFormat(".###"); for (String line = in.readLine(); line != null; line = in.readLine()) { String[] context = line.split(" "); double[] dist = m.eval(context); for (int oi=0;oi<dist.length;oi++) { System.out.print("["+m.getOutcome(oi)+" "+df.format(dist[oi])+"] "); } System.out.println(); } } } --- NEW FILE: Counter.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; /** * A simple class which is essentially an Integer which is mutable via * incrementation. * * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ public class Counter { private int counter = 1; public void increment() { counter++; } public int intValue() { return counter; } public boolean passesCutoff(int c) { return counter >= c; } } --- NEW FILE: GISTrainer.java --- /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.maxent; import opennlp.model.DataIndexer; import opennlp.model.EvalParameters; import opennlp.model.EventStream; import opennlp.model.MutableContext; import opennlp.model.OnePassDataIndexer; import opennlp.model.Prior; import opennlp.model.UniformPrior; /** * An implementation of Generalized Iterative Scaling. The reference paper * for this implementation was Adwait Ratnaparkhi's tech report at the * University of Pennsylvania's Institute for Research in Cognitive Science, * and is available at <a href ="ftp://ftp.cis.upenn.edu/pub/ircs/tr/97-08.ps.Z"><code>ftp://ftp.cis.upenn.edu/pub/ircs/tr/97-08.ps.Z</code></a>. * * The slack parameter used in the above implementation has been removed by default * from the computation and a method for updating with Gaussian smoothing has been * added per Investigating GIS and Smoothing for Maximum Entropy Taggers, Clark and Curran (2002). * <a href="http://acl.ldc.upenn.edu/E/E03/E03-1071.pdf"><code>http://acl.ldc.upenn.edu/E/E03/E03-1071.pdf</code></a> * The slack parameter can be used by setting <code>useSlackParameter</code> to true. * Gaussian smoothing can be used by setting <code>useGaussianSmoothing</code> to true. * * A prior can be used to train models which converge to the distribution which minimizes the * relative entropy between the distribution specified by the emperical constraints of the training * data and the specified prior. By default, the uniform distribution is used as the prior. * * @author Tom Morton * @author Jason Baldridge * @version $Revision: 1.1 $, $Date: 2009/01/22 23:23:34 $ */ class ... [truncated message content] |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:40
|
Update of /cvsroot/maxent/maxent/src/main/assembly In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/main/assembly Added Files: src.xml Log Message: Introduced maven build. --- NEW FILE: src.xml --- <?xml version="1.0" encoding="UTF-8"?> <!-- 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. --> <assembly> <id>src</id> <formats> <format>tar.gz</format> </formats> <fileSets> <fileSet> <includes> <include>docs/**</include> <include>samples/**</include> <include>AUTHORS</include> <include>CHANGESS</include> <include>COMMANDLINE</include> <include>LICENSE</include> <include>pom.xml</include> <include>README</include> </includes> </fileSet> <fileSet> <directory>src</directory> </fileSet> </fileSets> </assembly> |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:40
|
Update of /cvsroot/maxent/maxent/src/main/assembly In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20839/src/main/assembly Log Message: Directory /cvsroot/maxent/maxent/src/main/assembly added to the repository |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:39
|
Update of /cvsroot/maxent/maxent/src/main/java/opennlp/model In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20839/src/main/java/opennlp/model Log Message: Directory /cvsroot/maxent/maxent/src/main/java/opennlp/model added to the repository |
Update of /cvsroot/maxent/maxent/src/java/opennlp/maxent In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/java/opennlp/maxent Removed Files: ModelReplacementManager.java BasicEventStream.java ModelSetter.java ContextGenerator.java GIS.java package.html PlainTextByLineDataStream.java GISModel.java Counter.java IntegerPool.java ModelDomain.java Evalable.java GISFormat DomainToModelMap.java Main.java TrainEval.java BinToAscii.java BasicContextGenerator.java AllEnglishAffixes.txt DataStream.java RealBasicEventStream.java GISTrainer.java Log Message: Introduced maven build. --- ModelReplacementManager.java DELETED --- --- BasicEventStream.java DELETED --- --- ModelSetter.java DELETED --- --- ContextGenerator.java DELETED --- --- GIS.java DELETED --- --- package.html DELETED --- --- PlainTextByLineDataStream.java DELETED --- --- GISModel.java DELETED --- --- Counter.java DELETED --- --- IntegerPool.java DELETED --- --- ModelDomain.java DELETED --- --- Evalable.java DELETED --- --- GISFormat DELETED --- --- DomainToModelMap.java DELETED --- --- Main.java DELETED --- --- TrainEval.java DELETED --- --- BinToAscii.java DELETED --- --- BasicContextGenerator.java DELETED --- --- AllEnglishAffixes.txt DELETED --- --- DataStream.java DELETED --- --- RealBasicEventStream.java DELETED --- --- GISTrainer.java DELETED --- |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:39
|
Update of /cvsroot/maxent/maxent/src/test/resources/data/opennlp/maxent/io In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/test/resources/data/opennlp/maxent/io Added Files: rvfes-bug-data-ok.txt rvfes-bug-data-broken.txt Log Message: Introduced maven build. --- NEW FILE: rvfes-bug-data-ok.txt --- C goodbye C goodbye=1.0 --- NEW FILE: rvfes-bug-data-broken.txt --- C goodbye=1.0 C goodbye |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:38
|
Update of /cvsroot/maxent/maxent/test/src/opennlp/maxent/io In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/test/src/opennlp/maxent/io Removed Files: RealValueFileEventStreamTests.java Log Message: Introduced maven build. --- RealValueFileEventStreamTests.java DELETED --- |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:38
|
Update of /cvsroot/maxent/maxent/test/data/opennlp/maxent In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/test/data/opennlp/maxent Removed Files: repeat-weighting-training-data.txt real-valued-weights-training-data.txt Log Message: Introduced maven build. --- repeat-weighting-training-data.txt DELETED --- --- real-valued-weights-training-data.txt DELETED --- |
Update of /cvsroot/maxent/maxent/src/java/opennlp/maxent/io In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21001/src/java/opennlp/maxent/io Removed Files: SuffixSensitiveGISModelWriter.java GISModelReader.java BinaryGISModelReader.java BinaryGISModelWriter.java BinToAscii.java package.html GISModelWriter.java PooledGISModelReader.java ObjectGISModelReader.java PlainTextGISModelReader.java OldFormatGISModelReader.java PlainTextGISModelWriter.java ObjectGISModelWriter.java SuffixSensitiveGISModelReader.java Log Message: Introduced maven build. --- SuffixSensitiveGISModelWriter.java DELETED --- --- GISModelReader.java DELETED --- --- BinaryGISModelReader.java DELETED --- --- BinaryGISModelWriter.java DELETED --- --- BinToAscii.java DELETED --- --- package.html DELETED --- --- GISModelWriter.java DELETED --- --- PooledGISModelReader.java DELETED --- --- ObjectGISModelReader.java DELETED --- --- PlainTextGISModelReader.java DELETED --- --- OldFormatGISModelReader.java DELETED --- --- PlainTextGISModelWriter.java DELETED --- --- ObjectGISModelWriter.java DELETED --- --- SuffixSensitiveGISModelReader.java DELETED --- |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:37
|
Update of /cvsroot/maxent/maxent/src/test In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20839/src/test Log Message: Directory /cvsroot/maxent/maxent/src/test added to the repository |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:36
|
Update of /cvsroot/maxent/maxent/src/test/java/opennlp In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20839/src/test/java/opennlp Log Message: Directory /cvsroot/maxent/maxent/src/test/java/opennlp added to the repository |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:36
|
Update of /cvsroot/maxent/maxent/src/test/java/opennlp/maxent/io In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20839/src/test/java/opennlp/maxent/io Log Message: Directory /cvsroot/maxent/maxent/src/test/java/opennlp/maxent/io added to the repository |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:36
|
Update of /cvsroot/maxent/maxent/src/main/java/opennlp/perceptron In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20839/src/main/java/opennlp/perceptron Log Message: Directory /cvsroot/maxent/maxent/src/main/java/opennlp/perceptron added to the repository |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:35
|
Update of /cvsroot/maxent/maxent/src/test/resources/data/opennlp/maxent/io In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20839/src/test/resources/data/opennlp/maxent/io Log Message: Directory /cvsroot/maxent/maxent/src/test/resources/data/opennlp/maxent/io added to the repository |
From: Joern K. <joe...@us...> - 2009-01-22 23:23:35
|
Update of /cvsroot/maxent/maxent/src/main/java/opennlp/maxent In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20839/src/main/java/opennlp/maxent Log Message: Directory /cvsroot/maxent/maxent/src/main/java/opennlp/maxent added to the repository |