Nutch1.0开源搜索引擎与Paoding在e…

5个企业级SOC平台横向对比:IBM QRadar vs Splunk vs 奇安信NGSOC 本文深度对比了IBM QRadar、Splunk和奇安信NGSOC等五大企业级SOC平台的核心能力,从架构设计、威胁检测、运营效率、成本模型和行业适配度五个维度进行解析。文章特别强调安全运营中心(SOC)在现代企业中的关键作用,并提供了实战数据和优化建议,帮助企业选择最适合自身需求的SOC解决方案。 阅读详情

源:http://banditjava.javaeye.com/blog/468303

本文主要描述的是如何将paoding分词用plugin方式集成到 nutch1.0中去,在集成之前首先要在eclipse中把nutch1.0编译通过。然后,写一个中文分词程序,配置好插件配置文件,重新打包编译。 如果有linux环境,就可以直接进行编译,如果没有linux环境,还需要下载并配置cygwin等模拟linux环境。
 
     一.环境说明
         工具:myeclipse6.5 ,jdk1.6.0_14,tomcat-6.0.20
         软件:nutch1.0
         相关软件请自行google,下载安装
 
     二.配置eclipse
        新建nutch工程后,配译会报错
        1)下载缺失的包
    从http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-mp3/lib /,http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-rtf/lib /下载MP3跟rtf的jar文件,分别拷贝到src/plugin/parse-mp3/lib 和 src/plugin/parse-rtf/lib/文件夹下
 
         2)修改了@override错误
    org.apache.nutch.indexer.solr.SolrDeleteDuplicates;
    org.apache.nutch.util.domain.DomainStatistics;
        //@override错误   将override注释掉
 
        3)licensing issues修复
    到这一步,一般的工程都会有两个错误,nutch的official 1.0 release版本中,这两个问题因为licensing issues没有修复。接下来的就是最关键的部分了。
    修改src\plugin\parse-rtf\src\java\org\apache\nutch\parse\rtf下RTFParseFactory.java
    添加import org.apache.nutch.parse.ParseResult;
    将public Parse getParse(Content content) {
    改为public ParseResult getParse(Content content) {
    将return new ParseStatus(ParseStatus.FAILED,
                       ParseStatus.FAILED_EXCEPTION,
                       e.toString()).getEmptyParse(conf);
    改为return new ParseStatus(ParseStatus.FAILED,
            ParseStatus.FAILED_EXCEPTION,
              e.toString()).getEmptyParseResult(content.getUrl(), getConf());
    将return new ParseImpl(text,
                 new ParseData(ParseStatus.STATUS_SUCCESS,
                           title,
                           OutlinkExtractor.getOutlinks(text, this.conf),
                           content.getMetadata(),
                           metadata));
    改为return ParseResult.createParseResult(content.getUrl(),
                     new ParseImpl(text,
                         new ParseData(ParseStatus.STATUS_SUCCESS,
                             title,
                             OutlinkExtractor.getOutlinks(text, this.conf),
                             content.getMetadata(),
                             metadata)));

    修改src\plugin\parse-rtf\src\test\org\apache\nutch\parse\rtf下的TestRTFParser.java
    将parse = new ParseUtil(conf).parseByExtensionId("parse-rtf", content);
    改为parse = new ParseUtil(conf).parseByExtensionId("parse-rtf", content).get(urlString);
    到这一步,eclipse上面的工程就会没有错误了
 
 
         三.配置paoding插件
         1)写中文分词程序,继承NutchAnalyzer

package org.apache.nutch.analysis.zh;
// JDK imports
import java.io.Reader;
// Lucene imports
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
// Nutch imports
import org.apache.nutch.analysis.NutchAnalyzer;

public class ChineseAnalyzer extends NutchAnalyzer {    
    private final static Analyzer ANALYZER =
            new net.paoding.analysis.analyzer.PaodingAnalyzer();    
   
    public ChineseAnalyzer() { }
    public TokenStream tokenStream(String fieldName, Reader reader) {
        return ANALYZER.tokenStream(fieldName, reader);
    }

}
 
      2)配置插件目录在src/plugin下面,analysis-zh,lib-paoding-analyzers
      把上面写好的ChineseAnalyzer放到analysis-zh/src下面,
      修改plugin.xml文件
<plugin
   id="analysis-zh"
   name="Chinese Analysis Plug-in"
   version="1.0.0"
   provider-name="net.paoding.analysis">
   <runtime>
      <library name="analysis-zh.jar">
         <export name="*"/>
      </library>
   </runtime>
   <requires>
      <import plugin="nutch-extensionpoints"/>
      <import plugin="lib-paoding-analyzers"/>
   </requires>
   <extension id="org.apache.nutch.analysis.zh"
              name="Chinese Analyzer"
              point="org.apache.nutch.analysis.NutchAnalyzer">
      <implementation id="ChineseAnalyzer"
                      class="org.apache.nutch.analysis.zh.ChineseAnalyzer">
        <parameter name="lang" value="zh"/>
      </implementation>
   </extension>
</plugin>
 
         修改build.xml
         <project name="analysis-zh" default="jar-core">
  <import file="../build-plugin.xml"/>
  <!-- Build compilation dependencies -->
  <target name="deps-jar">
    <ant target="jar" inheritall="false" dir="../lib-paoding-analyzers"/>
  </target>
  <!-- Add compilation dependencies to classpath -->
  <path id="plugin.deps">
    <fileset dir="${nutch.root}/build">
      <include name="**/lib-paoding-analyzers/*.jar" />
    </fileset>
  </path>
</project>
       lib-paoding-analyzers的配置同上,不再赘述。
 
 
      3)配置src\plugin的build.xml
   <target name="deploy">
<ant dir="analysis-zh" target="deploy"/>
<ant dir="lib-paoding-analyzers" target="deploy"/>
...
   </target>

   <target name="clean">
<ant dir="analysis-zh" target="clean"/>
<ant dir="lib-paoding-analyzers" target="clean"/>
...
   </target>

4)修改nutch-default.xml,加入|analysis-(zh)|  加载paoding的jar包,和自己写的analysis-(zh) jar包
<property>
  <name>plugin.includes</name>
  <value>protocol-http|urlfilter-regex|parse-(text|html|js)|analysis-(zh)|index-basic|query-(basic|site|url)|summary-basic|scoring-opic|urlnormalizer-(pass|regex|basic)</value>
  <description>
  </description>
</property>
 
 
          5)修改nutch工程的build.xml,targe war
      <lib dir="${build.dir}/analysis-zh">
              <include name="analysis-zh.jar"/>
      </lib>   
      <lib dir="${build.dir}/lib-paoding-analyzers">
              <include name="paoding-analysis.jar"/>
      </lib>
 
      四.重新编译
       ant package
     注意:nutch1.0 需要ant1.7.1才行,主要是touch任务需要ant 1.7.1支持
 
      五.配置tomcat,修改webapps/cse/WEB-INF/classes/nutch-site.xml
<configuration>
  <property>
    <name>fs.default.name</name>
    <value>local</value>
  </property>

  <property><!--指定本地的index目录-->
    <name>searcher.dir</name>
    <value>/nutch/local/crawled</value>
  </property>
<property>  
</property>
</configuration>
 
     六.配置运行环境
     export PAODING_DIC_HOME=/nutch/dic
 
    七.运行测试
     http://localhost:8080/
 
2009-09-14 10:26:49,312 INFO  PluginRepository - Registered Plugins:
2009-09-14 10:26:49,312 INFO  PluginRepository -        the nutch core extension points (nutch-extensionpoints)
2009-09-14 10:26:49,312 INFO  PluginRepository -        Basic Query Filter (query-basic)
2009-09-14 10:26:49,312 INFO  PluginRepository -        Basic URL Normalizer (urlnormalizer-basic)
2009-09-14 10:26:49,312 INFO  PluginRepository -        Paoding Analysers (lib-paoding-analyzers)
2009-09-14 10:26:49,328 INFO  PluginRepository -        Html Parse Plug-in (parse-html)
2009-09-14 10:26:49,328 INFO  PluginRepository -        Basic Indexing Filter (index-basic)
2009-09-14 10:26:49,328 INFO  PluginRepository -        Basic Summarizer Plug-in (summary-basic)
2009-09-14 10:26:49,328 INFO  PluginRepository -        Site Query Filter (query-site)
2009-09-14 10:26:49,328 INFO  PluginRepository -        HTTP Framework (lib-http)
2009-09-14 10:26:49,328 INFO  PluginRepository -        Text Parse Plug-in (parse-text)
2009-09-14 10:26:49,328 INFO  PluginRepository -        Pass-through URL Normalizer (urlnormalizer-pass)
2009-09-14 10:26:49,328 INFO  PluginRepository -        Regex URL Filter (urlfilter-regex)
2009-09-14 10:26:49,328 INFO  PluginRepository -        Http Protocol Plug-in (protocol-http)
2009-09-14 10:26:49,328 INFO  PluginRepository -        XML Response Writer Plug-in (response-xml)
2009-09-14 10:26:49,328 INFO  PluginRepository -        Regex URL Normalizer (urlnormalizer-regex)
2009-09-14 10:26:49,328 INFO  PluginRepository -        OPIC Scoring Plug-in (scoring-opic)
2009-09-14 10:26:49,343 INFO  PluginRepository -        CyberNeko HTML Parser (lib-nekohtml)
2009-09-14 10:26:49,343 INFO  PluginRepository -        Anchor Indexing Filter (index-anchor)
2009-09-14 10:26:49,343 INFO  PluginRepository -        JavaScript Parser (parse-js)
2009-09-14 10:26:49,343 INFO  PluginRepository -        URL Query Filter (query-url)
2009-09-14 10:26:49,343 INFO  PluginRepository -        Chinese Analysis Plug-in (analysis-zh)
2009-09-14 10:26:49,343 INFO  PluginRepository -        Regex URL Filter Framework (lib-regex-filter)
2009-09-14 10:26:49,343 INFO  PluginRepository -        JSON Response Writer Plug-in (response-json)
2009-09-14 10:26:49,343 INFO  PluginRepository - Registered Extension-Points:
2009-09-14 10:26:49,359 INFO  PluginRepository -        Nutch Summarizer (org.apache.nutch.searcher.Summarizer)
 
其中hinese Analysis Plug-in (analysis-zh)就是配置好的中文分词插件啦。
 
好,大功告成,用paoding爽一爽吧,分词效果“刚刚的”。

Devexpress16.2.6破解工具 Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具 立即下载

相关推荐

ArcGIS山体坡度、坡向分析

本篇文章主要记录自己在对山体坡向及坡度分析中的一些操作。

Belence_zhao的博客 7418

Nutch1.0开源搜索引擎与Paoding在eclipse中用plugin方式集成(终极篇)

源:http://banditjava.javaeye.com/blog/468303本文主要描述的是如何将paoding分词用plugin方式集成到 nutch1.0中去,在集成之前首先要在eclipse中把nutch1.0编译通过。然后,写一个中文分词程序,配置好插件配置文件,重新打包编译。如果有linux环境,就可以直接进行编译,如果没有linux环境,还需要下载并配置cygwin等模拟

ousilian的专栏 930

UE5高斯泼溅落地全链路:从PLY导入到实时渲染的工程实践

3D高斯泼溅(3D Gaussian Splatting)正从NeRF后处理技术演进为新一代隐式几何渲染范式,其核心在于以可微椭球体替代传统三角面片,通过协方差矩阵与球谐系数实现高质量体素化渲染。该技术突破点云精度瓶颈,但与UE5现有资产管线存在根本性不兼容——静态网格导入器无法解析scale/rot/sh系数等非标顶点语义,标准光栅化管线亦无法执行高斯核采样计算。XV3DGS-UEPlugin通过自定义资产类型、StructuredBuffer GPU数据流与专用材质节点,将高斯泼溅重构为可编辑、可LOD

weixin_33692177的博客 366

Nutch 分词 中文分词 paoding 疱丁

Nutch中文分词总结2009年06月10日 星期三 22:381 中文分词介绍中文分词是在做检索类系统时需要重点考虑的一个因素。Nutch的本土化过程也需要更改对中文分词的支持。目前,Nutch中文分词方式大致有两种方式:一是修改源代码。这种方式是直接对Nutch分词处理类进行修改,调用已写好的一些分词组件进行分词。二是编写分词插件。这种方式是按照Nutch定义的插件

mutou12456的专栏 2982

Unity六边形网格A*寻路实战:从坐标转换到算法优化

寻路算法是游戏开发与AI领域的核心技术,它决定了智能体在虚拟空间中的移动决策能力。A*算法作为启发式搜索的经典实现,通过结合实际代价与预估代价,能在复杂环境中高效找到最优路径。其技术价值在于平衡了搜索效率与结果最优性,广泛应用于策略游戏、机器人导航和自动化规划等场景。在游戏开发中,六边形网格因其移动自然、邻接均衡的特性,常被用于《文明》等经典策略游戏的地图设计。本文聚焦于Unity环境下,针对尖头朝上六边形网格的A*寻路实现,深入解析了轴向坐标系的选型、邻居计算的优化策略以及地形代价的融合方法,为战棋类或策

weixin_29017445的博客 299

2023-ICCV-隐式神经网络实现低光照图像增强(NeRCo)论文解读+代码解析

NeRCo()提出了一种名为NeRCo的隐式神经表示方法,用于合作式低光图像增强。现有的低光图像增强方法存在以下三个限制:不可预测的亮度降低和噪声、度量友好版本和视觉友好版本之间的固有差距,以及有限的配对训练数据。为了解决这些限制,论文提出了NeRCo方法,它以无监督的方式稳健地恢复感知友好的结果。具体而言,NeRCo通过一个可控的拟合函数统一了现实场景中多样的退化因素,从而提高了鲁棒性。对于输出结果,论文引入了来自预训练视觉-语言模型的先验信息,采用语义导向的监督方法。

weixin_45595504的博客 3200

搜索引擎分词:Nutch整合Paoding中文分词步骤详解

搜索引擎+B2B平台+SNS网站=?, 一个三不像网站。偏偏投资人需要这样一个三不像网站。从4月份开始组建团队。时间一瞬2个月过去了。做B2B需要的就是大工作量和时间,而做搜索引擎光分词这块就搞的头大。在此结合开源数据写个一二,已备后用。 搜索引擎需要的就是数据,抓取海量数据、然后存储、分析、建立索引、计算,最终根据用户需求快速检索出结果。存储分析和建立索引的过程开源项目中有个Hadoop是

伟伟的专栏 442

[漏洞剖析]JeecgBoot queryFieldBySql注入与JDBC连接滥用:从内存马植入到RCE的完整攻击链

本文深度剖析了JeecgBoot框架中queryFieldBySql接口的SQL注入漏洞及其引发的完整攻击链。攻击者利用该漏洞,通过Freemarker SSTI植入隐蔽的内存马,并进一步滥用JDBC连接测试功能,借助H2数据库特性实现远程命令执行(RCE),揭示了低代码平台中功能滥用与安全配置疏忽带来的严重风险。

weixin_29232121的博客 117

Nutch开源搜索引擎与Paoding中文分…

本文是我在集成中文分词paoding时积累的经验,单独成一篇文章来重点介绍,重点需要了解的有下面几个文件,a)插件目录及插件文件 build.xml,plugin.xml b)nutch-0.9\src\plugin\build.xml  c)WEB-INF/classes/nutch-site.xml 然后通过按照下面的方式来配置,执行ant package就可以搞定了,这里用ant的方式来处理

nuoline的专栏 574

信奥赛C++提高组csp-s之数论基础专题课:从同余到分数模运算1(知识地图:同余、裴蜀定理、扩展欧几里得、乘法逆元、分数模运算)

信奥赛C++提高组csp-s之数论基础专题课:从同余到分数模运算1(知识地图:同余、裴蜀定理、扩展欧几里得、乘法逆元、分数模运算)

王老师青少年编程 794

影楼精修-肤色统一算法解析

本文介绍了影楼精修中肤色统一算法的实现方案,并以像素蛋糕软件为例进行详细分析。肤色统一旨在通过调整人像照片中皮肤区域的颜色,使其看起来更加均匀一致。像素蛋糕软件提供了AI肤色统一和传统肤色统一两种功能,分别适用于不同需求。传统肤色统一算法通过皮肤分割、人脸检测、亮度统一和颜色统一等步骤,实现了对皮肤区域的精细调整。文章还提供了亮度统一的核心代码,并对比了传统算法与AI算法的效果,指出AI算法在自然度和亮度矫正方面表现更优。整体而言,本文为影楼精修中的肤色统一提供了实用的技术参考。

Trent1985的专栏 2081

Nutch开源搜索引擎与Paoding中文分词用plugin方式集成[转]

本文是我在集成中文分词paoding时积累的经验,单独成一篇文章来重点介绍,重点需要了解的有下面几个文件,a)插件目录及插件文件 build.xml,plugin.xml b)nutch-0.9/src/plugin/build.xml  c)WEB-INF/classes/nutch-site.xml 然后通过按照下面的方式来配置,执行ant package就可以搞定了,这里用ant的方式来处理整个编译发布过程。 1)在src/plugin下面加入,analysis-zh和lib-paod

nutch_520的专栏 793

GEE:计算非水体概率影像(水体淹没次数)

本文记录了在GEE平台上使用哨兵数据计算沿海地区非水体概率图像的计算方法和代码。基于像素,概率范围0-100。首先使用哨兵数据(s2)和大津算法(OTSU)计算的水体指数阈值来提取水体,然后计算研究区非水体像素在时间段内出现的概率。

养乐多的博客 2152

Nutch开源搜索引擎与Paoding中文分词用plugin方式集成

本文是我在集成中文分词paoding时积累的经验,单独成一篇文章来重点介绍,重点需要了解的有下面几个文件,a)插件目录及插件文件 build.xml,plugin.xml b)nutch-0.9\src\plugin\build.xml c)WEB-INF/classes/nutch-site.xml 然后通过按照下面的方式来配置,执行ant package就可以搞定了,这里用ant的方式来...

匪夷所思的人 173

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

研究Nutch开源搜索引擎心得记录

---------------20080828------------ 下载源码,初步研究 --------------20080829------------- http://blog.csdn.net/lianqiang198505/archive/2007/04/18/1569680.aspx 前两天试用了nutch目前的最新版本。这个版本是完全建立在hadoop基础上的,也就是一...

匪夷所思的人 243

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

Nutch中文分词总结

1 中文分词介绍 中文分词是在做检索类系统时需要重点考虑的一个因素。Nutch的本土化过程也需要更改对中文分词的支持。目前,Nutch中文分词方式大致有两种方式: 一是修改源代码。这种方式是直接对Nutch分词处理类进行修改,调用已写好的一些分词组件进行分词。 二是编写分词插件。这种方式是按照Nutch定义的插件编写规则重新编写或者添加中文分词插件。 以上两种方式都是可取的。目前,由于...

a280606790的专栏 336

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

开源的桌面搜索引擎

1.Regain regain是一款与Web搜索引擎类似的桌面搜索引擎系统,其不同之处在于regain不是对Internet内容的搜索,而是针对自己的文档或文件的搜索,使用regain可以轻松地在几秒内完成大量数据(许多个G)的搜索。Regain采用了Lucene的搜索语法,因此支持多种查询方式,支持多索引的搜索及基于文件类型的高级搜索,并且能实现URL重写及文件到HTTP的桥接,并且对中文也提供

nuoline的专栏 3980

nutch-1.0添加imdict-chinese-anal…

1 前言 昨天在nutch中添加了JE中文分词,今天有试了下基于中科院的多层隐马模型的分词组件,imdict-chinese-analyzer,目前这个组件已经正式集成到lucene-3.0,具体在要用到lucene-analyzers-3.0.1.jar 和  lucene-smartcn-3.0.1.jar 这二个包在contrib\analyzers文件,由于nutch-1.0中的lucen

nuoline的专栏 3304

nutch中文分词

1 中文分词介绍 中文分词是在做检索类系统时需要重点考虑的一个因素。Nutch的本土化过程也需要更改对中文分词的支持。目前,Nutch中文分词方式大致有两种方式: 一是修改源代码。这种方式是直接对Nutch分词处理类进行修改,调用已写好的一些分词组件进行分词。 二是编写分词插件。这种方式是按照Nutch定义的插件编写规则重新编写或者添加中文分词插件。 以上两种方式都是可取的。目前,由于开源社区的

nuoline的专栏 1990

imdict-chinese-analyzer

imdict-chinese-analyzer 是 imdict智能词典 的智能中文分词模块,算法基于隐马尔科夫模型(Hidden Markov Model, HMM),是中国科学院计算技术研究所的ictclas中文分词程序的重新实现(基于Java),可以直接为lucene搜索引擎提供简体中文分词支持。 Apache Lucene的中文分词 Apache Lucene是java实现的一个高效的文本

nuoline的专栏 1642

提高Nutch局域网抓取的速度

如果想要提高Nutch局域网抓取的速度,大家第一个想到肯定是-threads .但是那是错误的,如果只是单单增大线程数,那根本于事无补。 通过下面这组测试,我们看看-threads 是否起作用。threads的值分别为1,5,10 结果如下表: 线程数 时间 1 891.001462 5 889.560529 10 878.812949 从上面表格可以看出,这根本

nuoline的专栏 869

nutch界面修改

目录: 1.Nutch1.2二次开发详细攻略(一)【图文】------Windows平台下Cygwin环境的搭建 2.Nutch1.2二次开发详细攻略(二)【图文】------Windows平台下Nutch1.2的搭建 3.Nutch1.2二次开发详细攻略(三)【图文】------Nutch1.2二次开发(关于界面修改) 4.Nutch1.2二次开发详细攻略(四)【图文】------Nut

nuoline的专栏 722

Lucene3.0的几种分词系统

1、 StopAnalyzer StopAnalyzer能过滤词汇中的特定字符串和词汇,并且完成大写转小写的功能。 2、 StandardAnalyzer StandardAnalyzer根据空格和符号来完成分词,还可以完成数字、字母、E-mail地址、IP地址以及中文字符的分析处理,还可以支持过滤词表,用来代替StopAnalyzer能够实现的过滤功能。 3、 SimpleAnalyzer Si

nuoline的专栏 718

nutch-1.0添加JE中文分词-修改源码…

这几天一直在搞nutch中文分词,也转载了好几篇文章,但是都写的比较简单而且有错误,估计原作者肯定也是实现了,今天终于搞定了,介绍一下我实现的方法。 1 nutch有两种方式可以实现自定义的分词: 1>,直接修改源代码,对默认的分词器代码进行修改使其使用自定义中文分词程序。 2> ,插件机制,可以在不修改源代码基础上,以插件形式集成自定义中文分词功能。这中法可以参考nutch已经集成的德语和法语

nuoline的专栏 666
上一篇: nutch中文分词
下一篇: imdict-chinese-analyzer
nuoline
博客等级 码龄19年 345粉丝 247原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址