RE: [Classifier4j-devel] Training and Classifying
Status: Beta
Brought to you by:
nicklothian
From: Neil G. <np...@nt...> - 2004-05-18 14:24:29
|
Hi Nick, > Is PostgreSQL case sensitive with respect to table names? PostgreSQL is not case-sensitive - I have tested this. > If that doesn't help, can please send the result set returned from the > following code: > > DatabaseMetaData dbm = con.getMetaData(); > ResultSet rs = dbm.getTables(null, null, "word_probability", null); I'm not too sure what you mean when you say to "send the result set" to you. What method should I call on the ResultSet. When I do: ResultSetMetaData rM = rs.getMetaData(); String name = rM.getColumnName(2); The value of name is "table_schem". Shouldn't it be one of the names of the columns in the word_probability table?? Regards Neil > -----Original Message----- > From: cla...@li... [mailto:classifier4j- > dev...@li...] On Behalf Of Nick Lothian > Sent: 18 May 2004 12:51 > To: cla...@li... > Subject: Re: [Classifier4j-devel] Training and Classifying > > Neil Gandhi wrote: > > >Hi Nick, > > > >Thanks for the reply, however there is still a problem. > > > >The following outlines how I am trying to access the data I have trained > >in the "word_probability" table. I wish to classify the String > >'contents' against the data in the "word_probability" table: > > > > DriverMangerJDBCConnectionManager cm = new > >DriverMangerJDBCConnectionManager(connString, user, pw); > > > > JDBCWordsDataSource wds = new JDBCWordsDataSource(cm); > > > > ITokenizer tokenizer = new DefaultTokenizer(); > > > > IClassifier classifier = new BayesianClassifier(wds, tokenizer); > > > > classifier.classify(contents); > > > > > >I get a system error message saying: > >net.sf.classifier4J.bayesian.WordsDataSourceException: Problem creating > >table > > > >and > > > >Caused by: java.sql.SQLException: ERROR: Relation 'word_probability' > >already exists > > > >It seems as if the JDBCWordsDataSource constructor is always trying to > >create a table, when I just want to be able to read from the existing > >table! > > > >I am using a Postgres SQL database. > > > >I would very much appreciate you providing some code which enables me to > >read from the "word_probability" table and then use the standard methods > >to classify an unknown string. > > > > > > > > The code you have is exactly correct. > > As previously noted, Classifier4J has been tested with MySQL & HSQLDB. > PostgreSQL _should_ work fine with it, provided the JDBC driver supports > the database metadata functionality correctly. > > Is PostgreSQL case sensitive with respect to table names? If so there > was a bug we fixed after the 0.5 release that may effect you. Get the > latest version from CVS, (or do the change yourself: see > <http://cvs.sourceforge.net/viewcvs.py/classifier4j/Classifier4J/src/jav a/ > net/sf/classifier4J/bayesian/JDBCWordsDataSource.java?r1=1.13&r2=1.14>) > > If that doesn't help, can please send the result set returned from the > following code: > > DatabaseMetaData dbm = con.getMetaData(); > ResultSet rs = dbm.getTables(null, null, "word_probability", null); > > Nick > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > _______________________________________________ > Classifier4j-devel mailing list > Cla...@li... > https://lists.sourceforge.net/lists/listinfo/classifier4j-devel |