一个色的导航资源精品在线观看|手机看片在线精品视频|伊人亚洲成人电影|亚洲欧美在线男女|无码无码在线观看五月精品视频在线|超碰日韩欧美在线|午夜精品蜜桃一区二区久久久|91欧美动态国产精品女主播|色欲色香天天天综合网在线观看免费|伊人春色在线伊人

2017寧德時(shí)代上市時(shí)間?

時(shí)間:2025-01-13 02:49 人氣:0 編輯:招聘街

一、2017寧德時(shí)代上市時(shí)間?

寧德時(shí)代(300750)上市日期是2018年06月11日。

江蘇時(shí)代動(dòng)力及儲(chǔ)能鋰離子電池研發(fā)與生產(chǎn)項(xiàng)目(三期)截止日期2020年07月30日,計(jì)劃投資74萬萬元,已投入募集資金3.49萬萬元,建設(shè)期--年,預(yù)計(jì)收益率(稅后)--,預(yù)計(jì)投資回收期--年。

公司經(jīng)營(yíng)范圍:鋰離子電池、鋰聚合物電池、燃料電池、動(dòng)力電池、超大容量?jī)?chǔ)能電池、超級(jí)電容器、電池管理系統(tǒng)及可充電電池包、風(fēng)光電儲(chǔ)能系統(tǒng)、相關(guān)設(shè)備儀器的開發(fā)、生產(chǎn)和銷售及售后服務(wù);對(duì)新能源行業(yè)的投資。(依法須經(jīng)批準(zhǔn)的項(xiàng)目,經(jīng)相關(guān)部門批準(zhǔn)后方可開展經(jīng)營(yíng)活動(dòng))

二、2017特崗教師面試題目

2017特崗教師面試題目

在當(dāng)今教育領(lǐng)域,成為一名教師是許多人的夢(mèng)想和追求。特崗教師是一個(gè)備受關(guān)注的職位,而2017年的特崗教師面試題目也備受廣大教育工作者和求職者的關(guān)注。面試題目的設(shè)置旨在考察應(yīng)聘者的專業(yè)知識(shí)、教學(xué)能力、綜合素質(zhì)等方面,是對(duì)求職者綜合能力的一次全面考量。下面將對(duì)2017年特崗教師面試題目進(jìn)行詳細(xì)介紹和解析,希望對(duì)即將面試的人員有所幫助。

專業(yè)知識(shí)類面試題目

專業(yè)知識(shí)類面試題目是特崗教師面試中的重中之重,包括教育學(xué)、心理學(xué)、教學(xué)法等專業(yè)知識(shí)內(nèi)容。在2017年的特崗教師面試中,關(guān)于專業(yè)知識(shí)的問題涉及到教育改革、素質(zhì)教育、課程設(shè)計(jì)等方面,需要應(yīng)聘者對(duì)教育教學(xué)的基本原理和理論有所了解和掌握。

教學(xué)能力類面試題目

教學(xué)能力是特崗教師應(yīng)具備的重要素質(zhì)之一,也是面試中必定會(huì)涉及的內(nèi)容。在2017年的特崗教師面試中,針對(duì)教學(xué)能力的問題主要包括課堂管理、教學(xué)設(shè)計(jì)、學(xué)生評(píng)價(jià)等方面,考察應(yīng)聘者的實(shí)際教學(xué)能力和實(shí)踐經(jīng)驗(yàn)。

綜合素質(zhì)類面試題目

特崗教師的招聘要求不僅包括專業(yè)知識(shí)和教學(xué)能力,還需要具備一定的綜合素質(zhì)和能力。在2017年的特崗教師面試中,綜合素質(zhì)類面試題目主要考察應(yīng)聘者的綜合素質(zhì)、溝通能力、團(tuán)隊(duì)合作精神等方面,以確保招聘的特崗教師能夠勝任教育教學(xué)工作。

面試技巧與注意事項(xiàng)

除了準(zhǔn)備面試題目外,應(yīng)聘者還應(yīng)了解一些面試技巧和注意事項(xiàng),以提高面試的成功率。建議應(yīng)聘者在面試前充分準(zhǔn)備,熟悉自己的簡(jiǎn)歷和求職材料,展現(xiàn)出自信和積極的態(tài)度。同時(shí),在回答問題時(shí)要清晰明了,表達(dá)準(zhǔn)確且簡(jiǎn)潔,避免答非所問或唐突回答。

在面試過程中,應(yīng)聘者要注意言行舉止得體,保持禮貌和謙虛的態(tài)度。與面試官的交流要主動(dòng)積極,展現(xiàn)自己的特長(zhǎng)和優(yōu)勢(shì)。最后,面試結(jié)束后要及時(shí)向面試官表達(dá)感謝,并對(duì)自己的表現(xiàn)進(jìn)行總結(jié)和反思,為下一次的面試做準(zhǔn)備。

結(jié)語(yǔ)

總的來說,2017年特崗教師面試題目涉及專業(yè)知識(shí)、教學(xué)能力、綜合素質(zhì)等多個(gè)方面,是對(duì)求職者綜合能力的全面考驗(yàn)。通過充分的準(zhǔn)備和自信的表現(xiàn),相信每一位應(yīng)聘者都能在面試中展現(xiàn)出自己的實(shí)力和魅力,順利躋身于特崗教師的行列。希望以上介紹對(duì)您有所幫助,祝您在未來的求職之路上取得成功!

三、2017福田時(shí)代馭菱國(guó)幾?

2017福田時(shí)代馭菱是國(guó)五排放標(biāo)準(zhǔn)

四、2017誰在瑞典提出了 時(shí)代之問?

2017年在瑞典提出了 時(shí)代之問的是格蕾塔·桑伯格(Greta Thunberg,2003年1月3日-),瑞典環(huán)境保護(hù)主義者,美國(guó)《時(shí)代》周刊2019年的“年度人物”。

她為提高人類對(duì)全球變暖和氣候變化問題的警覺性而在瑞典議會(huì)外進(jìn)行“為氣候罷課”行動(dòng),并在COP24上發(fā)言而知名,后被提名為2019年諾貝爾和平獎(jiǎng)候選人。

五、2003年到2017年是什么時(shí)代?

從2003年到2017年這十幾年十年內(nèi)是處于中華人民共和國(guó)時(shí)代也稱為是現(xiàn)代社會(huì)的經(jīng)濟(jì)騰飛時(shí)代。在這十幾年時(shí)間內(nèi)中國(guó)的經(jīng)濟(jì)方面和其他科研等各方面取得了長(zhǎng)足的進(jìn)展,中國(guó)的經(jīng)濟(jì)由03年的時(shí)候一道棱2017年經(jīng)濟(jì)總量達(dá)到了世界第二的位置。所以說這十幾年時(shí)間內(nèi)中國(guó)處于經(jīng)濟(jì)騰飛的時(shí)代。也可以稱作是電子商務(wù)時(shí)代。

六、2007年到2017年是什么時(shí)代?

2007年至2017年是信息時(shí)代。信息化時(shí)代就是信息產(chǎn)生價(jià)值的時(shí)代,信息化是當(dāng)今時(shí)代發(fā)展的大趨勢(shì),代表著先進(jìn)生產(chǎn)力。

歐美及發(fā)達(dá)國(guó)家的時(shí)間跨度概念是從公元后1969年(1969AD)-未來,我國(guó)及部分發(fā)展中國(guó)家對(duì)信息時(shí)代指的是從公元后1984年(1984AD)-未來,比歐美晚了15年。

人們常用最具代表性的生產(chǎn)工具來代表一個(gè)歷史時(shí)期,人類文明的發(fā)展時(shí)代歷程:如石器時(shí)代,紅銅時(shí)代,青銅時(shí)代,鐵器時(shí)代,蒸汽時(shí)代、電氣時(shí)代、原子時(shí)代等。用這種思維模式來觀照20世紀(jì),你會(huì)說,在近100年里,人類從原子時(shí)代走向了信息時(shí)代。

七、大數(shù)據(jù)時(shí)代2017年

在大數(shù)據(jù)時(shí)代的影響下,2017年成為了科技和信息領(lǐng)域的轉(zhuǎn)折點(diǎn)。大數(shù)據(jù)技術(shù)的快速發(fā)展與不斷創(chuàng)新,徹底改變了我們生活和工作的方方面面。

大數(shù)據(jù)技術(shù)應(yīng)用廣泛

2017年,大數(shù)據(jù)技術(shù)在各行各業(yè)得到了廣泛應(yīng)用。從金融領(lǐng)域的風(fēng)險(xiǎn)管理到電商行業(yè)的精準(zhǔn)營(yíng)銷,大數(shù)據(jù)正在幫助企業(yè)更好地了解市場(chǎng)需求和客戶行為,從而制定更加精準(zhǔn)的決策。

在醫(yī)療領(lǐng)域,大數(shù)據(jù)分析正在發(fā)揮著重要作用,幫助醫(yī)生提前發(fā)現(xiàn)疾病跡象、改善診斷準(zhǔn)確率,甚至為研究團(tuán)隊(duì)提供關(guān)鍵的數(shù)據(jù)支持。

大數(shù)據(jù)安全挑戰(zhàn)

然而,隨著大數(shù)據(jù)的廣泛應(yīng)用,安全問題也日益凸顯。2017年,大數(shù)據(jù)安全成為行業(yè)關(guān)注的焦點(diǎn)之一。數(shù)據(jù)泄露、隱私問題等挑戰(zhàn)不斷涌現(xiàn),給企業(yè)和個(gè)人的信息安全帶來了極大的威脅。

因此,加強(qiáng)大數(shù)據(jù)安全意識(shí),制定嚴(yán)格的數(shù)據(jù)管理政策變得尤為重要。企業(yè)應(yīng)加強(qiáng)數(shù)據(jù)加密、訪問控制等措施,保障數(shù)據(jù)的安全性和完整性。

大數(shù)據(jù)發(fā)展趨勢(shì)

在2017年,大數(shù)據(jù)技術(shù)不斷發(fā)展壯大,呈現(xiàn)出明顯的趨勢(shì)。云計(jì)算、人工智能、物聯(lián)網(wǎng)等新技術(shù)的融合,使大數(shù)據(jù)處理更加高效、精準(zhǔn)。

同時(shí),大數(shù)據(jù)技術(shù)的普及也帶動(dòng)了相關(guān)人才的需求。數(shù)據(jù)科學(xué)家、分析師等專業(yè)人士的需求逐漸增加,大數(shù)據(jù)行業(yè)成為了未來的就業(yè)熱點(diǎn)之一。

結(jié)語(yǔ)

綜合來看,2017年是大數(shù)據(jù)時(shí)代的重要節(jié)點(diǎn),大數(shù)據(jù)技術(shù)的發(fā)展為社會(huì)帶來了巨大的變革。在未來,隨著技術(shù)的進(jìn)一步完善和深入,大數(shù)據(jù)將繼續(xù)發(fā)揮重要作用,推動(dòng)各行各業(yè)邁向更加智能化和高效化的發(fā)展。

八、2017java面試題百度云

2017Java面試題百度云

在面試準(zhǔn)備過程中,了解并掌握常見的面試題是至關(guān)重要的。本文將介紹2017年Java面試中涉及到的百度云相關(guān)問題,幫助讀者更好地準(zhǔn)備面試。

1. 百度云是什么?

百度云是百度公司推出的云計(jì)算服務(wù)平臺(tái),為用戶提供云存儲(chǔ)、云計(jì)算、云數(shù)據(jù)庫(kù)等服務(wù)。在云計(jì)算領(lǐng)域,百度云擁有豐富的產(chǎn)品線,能夠滿足不同用戶的需求。

2. Java在百度云中的應(yīng)用

Java作為一種主流的編程語(yǔ)言,在百度云的應(yīng)用也非常廣泛。很多百度云的后端服務(wù)都是采用Java語(yǔ)言編寫的,因此熟練掌握J(rèn)ava語(yǔ)言對(duì)于在百度云工作的人來說至關(guān)重要。

3. 2017年Java面試題示例

以下是2017年Java面試中可能會(huì)涉及到的一些百度云相關(guān)題目示例:

  • 問題1: 什么是百度云的對(duì)象存儲(chǔ)服務(wù)?
  • 問題2: 請(qǐng)簡(jiǎn)要介紹一下百度云的數(shù)據(jù)處理服務(wù)。
  • 問題3: 如何在百度云上部署一個(gè)使用Java編寫的Web應(yīng)用程序?
  • 問題4: 請(qǐng)解釋一下百度云中的分布式文件系統(tǒng)。

4. 面試準(zhǔn)備建議

在準(zhǔn)備面試時(shí),除了熟悉Java語(yǔ)言和百度云的相關(guān)知識(shí)外,還應(yīng)該重點(diǎn)關(guān)注以下幾個(gè)方面:

  1. 深入了解百度云的產(chǎn)品和服務(wù),包括云存儲(chǔ)、云計(jì)算、大數(shù)據(jù)等。
  2. 學(xué)習(xí)掌握J(rèn)ava語(yǔ)言的核心概念和常用技術(shù)。
  3. 多做一些項(xiàng)目實(shí)踐,提升自己的編程能力。
  4. 關(guān)注行業(yè)動(dòng)態(tài),了解云計(jì)算領(lǐng)域的最新發(fā)展。

結(jié)語(yǔ)

通過本文的介紹,相信讀者對(duì)2017年Java面試題中涉及到的百度云相關(guān)內(nèi)容有了一定的了解。在面試準(zhǔn)備過程中,持續(xù)學(xué)習(xí)和提升自己的能力是非常重要的,希望讀者能夠取得理想的面試成績(jī)。

九、時(shí)代峰峻2017年發(fā)生了什么?

時(shí)代峰峻是一個(gè)房地產(chǎn)開發(fā)商,2017年發(fā)生了一系列重要事件。首先,他們成功推出了幾個(gè)大型住宅項(xiàng)目,受到了市場(chǎng)的熱烈歡迎。

其次,他們與多家國(guó)際知名品牌合作,開設(shè)了一些高端商業(yè)中心,進(jìn)一步提升了公司的知名度和影響力。此外,時(shí)代峰峻還積極參與公益事業(yè),捐贈(zèng)資金和物資支持災(zāi)區(qū)重建和教育事業(yè)發(fā)展??傮w來說,2017年對(duì)于時(shí)代峰峻來說是一個(gè)充滿成就和發(fā)展的重要年份。

十、mahout面試題?

之前看了Mahout官方示例 20news 的調(diào)用實(shí)現(xiàn);于是想根據(jù)示例的流程實(shí)現(xiàn)其他例子。網(wǎng)上看到了一個(gè)關(guān)于天氣適不適合打羽毛球的例子。

訓(xùn)練數(shù)據(jù):

Day Outlook Temperature Humidity Wind PlayTennis

D1 Sunny Hot High Weak No

D2 Sunny Hot High Strong No

D3 Overcast Hot High Weak Yes

D4 Rain Mild High Weak Yes

D5 Rain Cool Normal Weak Yes

D6 Rain Cool Normal Strong No

D7 Overcast Cool Normal Strong Yes

D8 Sunny Mild High Weak No

D9 Sunny Cool Normal Weak Yes

D10 Rain Mild Normal Weak Yes

D11 Sunny Mild Normal Strong Yes

D12 Overcast Mild High Strong Yes

D13 Overcast Hot Normal Weak Yes

D14 Rain Mild High Strong No

檢測(cè)數(shù)據(jù):

sunny,hot,high,weak

結(jié)果:

Yes=》 0.007039

No=》 0.027418

于是使用Java代碼調(diào)用Mahout的工具類實(shí)現(xiàn)分類。

基本思想:

1. 構(gòu)造分類數(shù)據(jù)。

2. 使用Mahout工具類進(jìn)行訓(xùn)練,得到訓(xùn)練模型。

3。將要檢測(cè)數(shù)據(jù)轉(zhuǎn)換成vector數(shù)據(jù)。

4. 分類器對(duì)vector數(shù)據(jù)進(jìn)行分類。

接下來貼下我的代碼實(shí)現(xiàn)=》

1. 構(gòu)造分類數(shù)據(jù):

在hdfs主要?jiǎng)?chuàng)建一個(gè)文件夾路徑 /zhoujainfeng/playtennis/input 并將分類文件夾 no 和 yes 的數(shù)據(jù)傳到hdfs上面。

數(shù)據(jù)文件格式,如D1文件內(nèi)容: Sunny Hot High Weak

2. 使用Mahout工具類進(jìn)行訓(xùn)練,得到訓(xùn)練模型。

3。將要檢測(cè)數(shù)據(jù)轉(zhuǎn)換成vector數(shù)據(jù)。

4. 分類器對(duì)vector數(shù)據(jù)進(jìn)行分類。

這三步,代碼我就一次全貼出來;主要是兩個(gè)類 PlayTennis1 和 BayesCheckData = =》

package myTesting.bayes;

import org.apache.hadoop.conf.Configuration;

import org.apache.hadoop.fs.FileSystem;

import org.apache.hadoop.fs.Path;

import org.apache.hadoop.util.ToolRunner;

import org.apache.mahout.classifier.naivebayes.training.TrainNaiveBayesJob;

import org.apache.mahout.text.SequenceFilesFromDirectory;

import org.apache.mahout.vectorizer.SparseVectorsFromSequenceFiles;

public class PlayTennis1 {

private static final String WORK_DIR = "hdfs://192.168.9.72:9000/zhoujianfeng/playtennis";

/*

* 測(cè)試代碼

*/

public static void main(String[] args) {

//將訓(xùn)練數(shù)據(jù)轉(zhuǎn)換成 vector數(shù)據(jù)

makeTrainVector();

//產(chǎn)生訓(xùn)練模型

makeModel(false);

//測(cè)試檢測(cè)數(shù)據(jù)

BayesCheckData.printResult();

}

public static void makeCheckVector(){

//將測(cè)試數(shù)據(jù)轉(zhuǎn)換成序列化文件

try {

Configuration conf = new Configuration();

conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

String input = WORK_DIR+Path.SEPARATOR+"testinput";

String output = WORK_DIR+Path.SEPARATOR+"tennis-test-seq";

Path in = new Path(input);

Path out = new Path(output);

FileSystem fs = FileSystem.get(conf);

if(fs.exists(in)){

if(fs.exists(out)){

//boolean參數(shù)是,是否遞歸刪除的意思

fs.delete(out, true);

}

SequenceFilesFromDirectory sffd = new SequenceFilesFromDirectory();

String[] params = new String[]{"-i",input,"-o",output,"-ow"};

ToolRunner.run(sffd, params);

}

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

System.out.println("文件序列化失??!");

System.exit(1);

}

//將序列化文件轉(zhuǎn)換成向量文件

try {

Configuration conf = new Configuration();

conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

String input = WORK_DIR+Path.SEPARATOR+"tennis-test-seq";

String output = WORK_DIR+Path.SEPARATOR+"tennis-test-vectors";

Path in = new Path(input);

Path out = new Path(output);

FileSystem fs = FileSystem.get(conf);

if(fs.exists(in)){

if(fs.exists(out)){

//boolean參數(shù)是,是否遞歸刪除的意思

fs.delete(out, true);

}

SparseVectorsFromSequenceFiles svfsf = new SparseVectorsFromSequenceFiles();

String[] params = new String[]{"-i",input,"-o",output,"-lnorm","-nv","-wt","tfidf"};

ToolRunner.run(svfsf, params);

}

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

System.out.println("序列化文件轉(zhuǎn)換成向量失?。?#34;);

System.out.println(2);

}

}

public static void makeTrainVector(){

//將測(cè)試數(shù)據(jù)轉(zhuǎn)換成序列化文件

try {

Configuration conf = new Configuration();

conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

String input = WORK_DIR+Path.SEPARATOR+"input";

String output = WORK_DIR+Path.SEPARATOR+"tennis-seq";

Path in = new Path(input);

Path out = new Path(output);

FileSystem fs = FileSystem.get(conf);

if(fs.exists(in)){

if(fs.exists(out)){

//boolean參數(shù)是,是否遞歸刪除的意思

fs.delete(out, true);

}

SequenceFilesFromDirectory sffd = new SequenceFilesFromDirectory();

String[] params = new String[]{"-i",input,"-o",output,"-ow"};

ToolRunner.run(sffd, params);

}

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

System.out.println("文件序列化失?。?#34;);

System.exit(1);

}

//將序列化文件轉(zhuǎn)換成向量文件

try {

Configuration conf = new Configuration();

conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

String input = WORK_DIR+Path.SEPARATOR+"tennis-seq";

String output = WORK_DIR+Path.SEPARATOR+"tennis-vectors";

Path in = new Path(input);

Path out = new Path(output);

FileSystem fs = FileSystem.get(conf);

if(fs.exists(in)){

if(fs.exists(out)){

//boolean參數(shù)是,是否遞歸刪除的意思

fs.delete(out, true);

}

SparseVectorsFromSequenceFiles svfsf = new SparseVectorsFromSequenceFiles();

String[] params = new String[]{"-i",input,"-o",output,"-lnorm","-nv","-wt","tfidf"};

ToolRunner.run(svfsf, params);

}

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

System.out.println("序列化文件轉(zhuǎn)換成向量失?。?#34;);

System.out.println(2);

}

}

public static void makeModel(boolean completelyNB){

try {

Configuration conf = new Configuration();

conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

String input = WORK_DIR+Path.SEPARATOR+"tennis-vectors"+Path.SEPARATOR+"tfidf-vectors";

String model = WORK_DIR+Path.SEPARATOR+"model";

String labelindex = WORK_DIR+Path.SEPARATOR+"labelindex";

Path in = new Path(input);

Path out = new Path(model);

Path label = new Path(labelindex);

FileSystem fs = FileSystem.get(conf);

if(fs.exists(in)){

if(fs.exists(out)){

//boolean參數(shù)是,是否遞歸刪除的意思

fs.delete(out, true);

}

if(fs.exists(label)){

//boolean參數(shù)是,是否遞歸刪除的意思

fs.delete(label, true);

}

TrainNaiveBayesJob tnbj = new TrainNaiveBayesJob();

String[] params =null;

if(completelyNB){

params = new String[]{"-i",input,"-el","-o",model,"-li",labelindex,"-ow","-c"};

}else{

params = new String[]{"-i",input,"-el","-o",model,"-li",labelindex,"-ow"};

}

ToolRunner.run(tnbj, params);

}

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

System.out.println("生成訓(xùn)練模型失?。?#34;);

System.exit(3);

}

}

}

package myTesting.bayes;

import java.io.IOException;

import java.util.HashMap;

import java.util.Map;

import org.apache.commons.lang.StringUtils;

import org.apache.hadoop.conf.Configuration;

import org.apache.hadoop.fs.Path;

import org.apache.hadoop.fs.PathFilter;

import org.apache.hadoop.io.IntWritable;

import org.apache.hadoop.io.LongWritable;

import org.apache.hadoop.io.Text;

import org.apache.mahout.classifier.naivebayes.BayesUtils;

import org.apache.mahout.classifier.naivebayes.NaiveBayesModel;

import org.apache.mahout.classifier.naivebayes.StandardNaiveBayesClassifier;

import org.apache.mahout.common.Pair;

import org.apache.mahout.common.iterator.sequencefile.PathType;

import org.apache.mahout.common.iterator.sequencefile.SequenceFileDirIterable;

import org.apache.mahout.math.RandomAccessSparseVector;

import org.apache.mahout.math.Vector;

import org.apache.mahout.math.Vector.Element;

import org.apache.mahout.vectorizer.TFIDF;

import com.google.common.collect.ConcurrentHashMultiset;

import com.google.common.collect.Multiset;

public class BayesCheckData {

private static StandardNaiveBayesClassifier classifier;

private static Map<String, Integer> dictionary;

private static Map<Integer, Long> documentFrequency;

private static Map<Integer, String> labelIndex;

public void init(Configuration conf){

try {

String modelPath = "/zhoujianfeng/playtennis/model";

String dictionaryPath = "/zhoujianfeng/playtennis/tennis-vectors/dictionary.file-0";

String documentFrequencyPath = "/zhoujianfeng/playtennis/tennis-vectors/df-count";

String labelIndexPath = "/zhoujianfeng/playtennis/labelindex";

dictionary = readDictionnary(conf, new Path(dictionaryPath));

documentFrequency = readDocumentFrequency(conf, new Path(documentFrequencyPath));

labelIndex = BayesUtils.readLabelIndex(conf, new Path(labelIndexPath));

NaiveBayesModel model = NaiveBayesModel.materialize(new Path(modelPath), conf);

classifier = new StandardNaiveBayesClassifier(model);

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

System.out.println("檢測(cè)數(shù)據(jù)構(gòu)造成vectors初始化時(shí)報(bào)錯(cuò)。。。。");

System.exit(4);

}

}

/**

* 加載字典文件,Key: TermValue; Value:TermID

* @param conf

* @param dictionnaryDir

* @return

*/

private static Map<String, Integer> readDictionnary(Configuration conf, Path dictionnaryDir) {

Map<String, Integer> dictionnary = new HashMap<String, Integer>();

PathFilter filter = new PathFilter() {

@Override

public boolean accept(Path path) {

String name = path.getName();

return name.startsWith("dictionary.file");

}

};

for (Pair<Text, IntWritable> pair : new SequenceFileDirIterable<Text, IntWritable>(dictionnaryDir, PathType.LIST, filter, conf)) {

dictionnary.put(pair.getFirst().toString(), pair.getSecond().get());

}

return dictionnary;

}

/**

* 加載df-count目錄下TermDoc頻率文件,Key: TermID; Value:DocFreq

* @param conf

* @param dictionnaryDir

* @return

*/

private static Map<Integer, Long> readDocumentFrequency(Configuration conf, Path documentFrequencyDir) {

Map<Integer, Long> documentFrequency = new HashMap<Integer, Long>();

PathFilter filter = new PathFilter() {

@Override

public boolean accept(Path path) {

return path.getName().startsWith("part-r");

}

};

for (Pair<IntWritable, LongWritable> pair : new SequenceFileDirIterable<IntWritable, LongWritable>(documentFrequencyDir, PathType.LIST, filter, conf)) {

documentFrequency.put(pair.getFirst().get(), pair.getSecond().get());

}

return documentFrequency;

}

public static String getCheckResult(){

Configuration conf = new Configuration();

conf.addResource(new Path("/usr/local/hadoop/conf/core-site.xml"));

String classify = "NaN";

BayesCheckData cdv = new BayesCheckData();

cdv.init(conf);

System.out.println("init done...............");

Vector vector = new RandomAccessSparseVector(10000);

TFIDF tfidf = new TFIDF();

//sunny,hot,high,weak

Multiset<String> words = ConcurrentHashMultiset.create();

words.add("sunny",1);

words.add("hot",1);

words.add("high",1);

words.add("weak",1);

int documentCount = documentFrequency.get(-1).intValue(); // key=-1時(shí)表示總文檔數(shù)

for (Multiset.Entry<String> entry : words.entrySet()) {

String word = entry.getElement();

int count = entry.getCount();

Integer wordId = dictionary.get(word); // 需要從dictionary.file-0文件(tf-vector)下得到wordID,

if (StringUtils.isEmpty(wordId.toString())){

continue;

}

if (documentFrequency.get(wordId) == null){

continue;

}

Long freq = documentFrequency.get(wordId);

double tfIdfValue = tfidf.calculate(count, freq.intValue(), 1, documentCount);

vector.setQuick(wordId, tfIdfValue);

}

// 利用貝葉斯算法開始分類,并提取得分最好的分類label

Vector resultVector = classifier.classifyFull(vector);

double bestScore = -Double.MAX_VALUE;

int bestCategoryId = -1;

for(Element element: resultVector.all()) {

int categoryId = element.index();

double score = element.get();

System.out.println("categoryId:"+categoryId+" score:"+score);

if (score > bestScore) {

bestScore = score;

bestCategoryId = categoryId;

}

}

classify = labelIndex.get(bestCategoryId)+"(categoryId="+bestCategoryId+")";

return classify;

}

public static void printResult(){

System.out.println("檢測(cè)所屬類別是:"+getCheckResult());

}

}

相關(guān)資訊
熱門頻道

Copyright © 2024 招聘街 滇ICP備2024020316號(hào)-38