nutch 初次接触

最近一直在看lucene,了解到了 nutch,也同时了解了下 hadoop。

要在windows平台上使用nutch、hadoop ,需要安装cygwin,这个工具的安装很多blog上面都有介绍。我就不详细说了。关键是大家在安装的时候 选择把openssh也安装上。

这里先只说说我是如何运行起nutch的。

首先说下我的目录结构

F:

  cygwin/

             bin

             ...

  hadoop/

             bin

             ....

  nutch-0.9/

             bin

             ...

  javaEEServer/

             tomcat6.0/

                 bin

                 ....

 

首先进入nutch-0.9,创建文件夹urls,然后在该文件夹下面创建文件urls.txt,然后在该文本文件中输入你想抓取的站点,我这里以www.whieb.com 为例子。然后在进入nutch-0.9/conf下面,修改nutch-site.xml为如下。

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->
<!--修改前-->
<configuration>



</configuration>



============
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->
<!--修改后-->
<configuration>
 <property> 

<name>http.agent.name</name>

<value>nutch-0.9</value>

<description></description>

</property>

<property>

<name>http.agent.description</name>

<value>my agent</value>

<description></description>

</property>

<property>

<name>http.agent.url</name>

<value>http://www.whieb.com</value>

<description></description>

</property>

<property>

<name>http.agent.email</name>

<value>esteem_84@163.com</value>

<description></description>

</property>


</configuration>

 

       然后在修改文件craw-urlfilter.txt文件为:

# The url filter file used by the crawl command.

# Better for intranet crawling.
# Be sure to change MY.DOMAIN.NAME to your domain name.

# Each non-comment, non-blank line contains a regular expression
# prefixed by '+' or '-'.  The first matching pattern in the file
# determines whether a URL is included or ignored.  If no pattern
# matches, the URL is ignored.

# skip file:, ftp:, & mailto: urls
-^(file|ftp|mailto):

# skip image and other suffixes we can't yet parse
-\.(gif|GIF|jpg|JPG|png|PNG|ico|ICO|css|sit|eps|wmf|zip|ppt|mpg|xls|gz|rpm|tgz|mov|MOV|exe|jpeg|JPEG|bmp|BMP)$

# skip URLs containing certain characters as probable queries, etc.
-[?*!@=]

# skip URLs with slash-delimited segment that repeats 3+ times, to break loops
-.*(/.+?)/.*?\1/.*?\1/

# accept hosts in MY.DOMAIN.NAME
#+^http://([a-z0-9]*\.)*MY.DOMAIN.NAME/
+^http://www.whieb.com/

# skip everything else
-.

 

        然后在nutch-0.9目录下建立一个logs文件夹,用来存放日志文件。

    到此文件的目录应该为:

f:\nutch-0.9

     bin

     conf

     ...

     logs

     urls

然后启动cygwin,

执行如下命令:

 

其中命令:

bin/nutch crawl urls -dir mydir -depth 4 -threads 4 -topN 50 >&log1.log  为进行抓取

 

urls指定抓取的网站的目录

-dir指定抓取结果存放到哪里

-depth 指定抓取深度

-threads 指定开启多少个线程进行抓取

-topN 指定每个站点最多抓取多少

>&log1.log 指定日志存放的路径

 

执行完毕这些后,我们会发现在nutch-0.9目录下面会出现一个 mydir的目录,里面就是抓取获得的数据

然后,我们开始部署nutch的web应用,将nutch-0.9目录下面的nutch-0.9.war包拷贝到tomcat下面的webapps下面,然后启动服务器,tomcat会主动将该war包解包,我们进入解开的文件夹,进入到WEB-INF下面的class目录,修改nutch-site.xml为:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
	<property> 
  <name>http.agent.name</name> 
  <value>nutch-0.9</value> 
  <description></description> 
</property> 
<!-- file properties --> 
<property> 
 <name>searcher.dir</name>
  <value>F:\\nutch-0.9\\mydir</value>
  <description></description> 
</property> 
</configuration>

 

然后在重新启动tomcat,在浏览器中 运行:

http://127.0.0.1:8080/nutch-0.9,应该会看到如下的页面:

然后 我们可以进行搜索:

 

 

这样我们就搭建了nutch的应用。这只是一个初步的应用,具体的nutch的学习还得进一步进行。

PS:如果遇到中文乱码,可以修改下tomcat的server.xml文件,将其修改为:

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true"/>

 

 

内容概要:本文是一篇关于使用RandLANet模型对SensatUrban数据集进行点云语义分割的实战教程,系统介绍了从环境搭建、数据准备、模型训练与测试到精度评估的完整流程。文章详细说明了在Ubuntu系统下配置TensorFlow 2.2、CUDA及cuDNN等深度学习环境的方法,并指导用户下载和预处理SensatUrban数据集。随后,逐步讲解RandLANet代码的获取与运行方式,包括训练、测试命令的执行与参数含义,以及如何监控训练过程中的关键指标。最后,教程涵盖测试结果分析、向官方平台提交结果、解读评估报告及可视化效果等内容,并针对常见问题提供解决方案。; 适合人群:具备一定深度学习基础,熟悉Python编程和深度学习框架,从事计算机视觉或三维点云相关研究的学生、研究人员及工程师;适合希望动手实践点云语义分割项目的初学者与进阶者。; 使用场景及目标:①掌握RandLANet网络结构及其在点云语义分割任务中的应用;②学会完整部署一个点云分割项目,包括数据处理、模型训练、测试与性能评估;③为参与相关竞赛或科研项目提供技术支撑。; 阅读建议:建议读者结合提供的代码链接和密码访问完整资料,在本地或云端环境中边操作边学习,重点关注数据格式要求与训练参数设置,遇到问题时参考“常见问题与解决技巧”部分及时排查。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值