1. 程式人生 > >【基於WPF+OneNote+Oracle的中文圖片識別系統階段總結】之篇二:基於OneNote難點突破和批量識別

【基於WPF+OneNote+Oracle的中文圖片識別系統階段總結】之篇二:基於OneNote難點突破和批量識別

【小記】:大膽嘗試才能突破,某個中醫藥大學有一批圖片需要處理(ORC),然後進行資料探勘。之前沒有接觸過ORC這個東西,但是還是應允了。在網上搜索一番,關於中文圖片識別,最終敲定為基於微軟的OneNote,其識別率相對較高。網上這個技術點的資料真心不多,後來於部落格園找到一篇博文,但是那個程式還是bug百出,而且只是單處理。後來經過一番摸索逐個突破,批處理完成。然後進行介面設計,這些零碎工作完成後,便是入庫處理。由於OneNote生成的xml檔案封裝好的,即不可視的。便將其程式碼處理生成txt檔案,再進行Oracle入庫處理。入庫前需要檔案內容稽核,並且在WPF開發中資料繫結和分頁中做了獨特處理。現在經過半個月的工作,本專案做個階段總結。一則知識總結便於二次開發,儘量保持程式流暢性,核心知識做以梳理;另外,相關WPF和OneNote常用技術共享,便於部分園友所需。本人技術有限,歡迎交流。專案還未結束,暫作階段文章釋出,隨後相繼釋出。

篇二:基於OneNote難點突破和批量識別

【1】開篇概述:在對本章技術介紹前,還是梳理下思路。描述下本章功能和開發過程。做個系統大致瞭解之後,在粘貼出本節效果圖配以完整程式碼,然後分拆之,個體技術剖析。這樣既可以達到全域性整體效果,也可以對區域性技術或者知識點做以小結。功能看圖描述:本程式開發基於C#+WPF,然後這些條件具備前需要安裝office2010以上版本,包含OneNote即可

 

完整程式碼:

namespace OnenoteOCRDemo
{
    /// <summary>
    /// Main.xaml 的互動邏輯
    /// </summary>
public partial class Main : Window { #region 全域性變數 private string __OutputFileName = string.Empty; private WebClient client = new WebClient(); private delegate void UpdateProgressBarDelegate(System.Windows.DependencyProperty dp, Object value);
#endregion #region 系統函式 public Main() { InitializeComponent(); } #endregion #region 使用者函式 #region 驗證資料夾是否存在,以及是否為空 :2014-7-10 17:12:57 //驗證資料夾是否存在,以及是否為空 //時間:2014-7-10 14:54:44 //作者:白寧超 private bool fn資料驗證() { if ((bool)this.rbtn本地圖片.IsChecked) { if (!Directory.Exists(this.txtfile.Text)) { this.labMsg.Content = "目錄不存在,重新選擇!"; this.txtfile.Focus(); return true; } System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(@txtfile.Text); if (di.GetFiles().Length + di.GetDirectories().Length == 0) { this.labMsg.Content = "目錄為空!"; this.txtfile.Focus(); return true; } } if (!Directory.Exists(this.txt輸出目錄.Text)) { this.labMsg.Content = "輸出目錄不存在,請重新選擇。"; this.txt輸出目錄.Focus(); return true; } return false; } #endregion #region 遍歷出文件中圖片路徑 //檔案中選擇所有檔案處理 //時間:2014-7-10 17:17:29 //作者:白寧超 public List<string> GetImgPath(string Filepath) { DirectoryInfo d = new DirectoryInfo(Filepath); ArrayList Flst = GetAll(d); //存放圖片完整路徑 List<string> imgpath = new List<string>(); foreach (object o in Flst) { imgpath.Add(@txtfile.Text + "\\" + o.ToString()); } return imgpath;//返回圖片路徑集合 } #endregion #region 獲取圖片的過程 private void fnStartDownload(string v_strImgPath, string v_strOutputDir, out string v_strTmpPath) { int n = v_strImgPath.LastIndexOf('/'); string URLAddress = v_strImgPath.Substring(0, n); string fileName = v_strImgPath.Substring(n + 1, v_strImgPath.Length - n - 1); this.__OutputFileName = v_strOutputDir + "\\" + fileName.Substring(0, fileName.LastIndexOf(".")) + ".txt"; if (!Directory.Exists(System.Configuration.ConfigurationManager.AppSettings["tmpPath"])) { Directory.CreateDirectory(System.Configuration.ConfigurationManager.AppSettings["tmpPath"]); } string Dir = System.Configuration.ConfigurationManager.AppSettings["tmpPath"]; v_strTmpPath = Dir + "\\" + fileName; this.client.DownloadFile(v_strImgPath, v_strTmpPath); } #endregion #region//刪除指定目錄下的所有資料夾以及檔案 private void DelFillOrDir(string strPath) { if (Directory.GetDirectories(strPath).Length > 0 || Directory.GetFiles(strPath).Length > 0) { // 獲得資料夾陣列  string[] strDirs = System.IO.Directory.GetDirectories(strPath); // 獲得檔案陣列  string[] strFiles = System.IO.Directory.GetFiles(strPath); // 遍歷所有子資料夾  foreach (string strFile in strFiles) { // 刪除資料夾  System.IO.File.Delete(strFile); } // 遍歷所有檔案  foreach (string strdir in strDirs) { // 刪除檔案  System.IO.Directory.Delete(strdir, true); } } // 成功  } #endregion #region//刪除檔案 public static bool DeleteFile(string xmlPath) { FileInfo newFile = new FileInfo(xmlPath); if (newFile.Exists == true) { newFile.Delete(); return true; } else { return false; } } #endregion #region//刪除xml資料 public void DeleteXML(string xpath) { var onenoteApp = new Microsoft.Office.Interop.OneNote.Application(); //onenote提供的API string notebookXml; onenoteApp.GetHierarchy(null, Microsoft.Office.Interop.OneNote.HierarchyScope.hsPages, out notebookXml); var docc = XDocument.Parse(notebookXml); var ns = docc.Root.Name.Namespace; XDocument doc = XDocument.Load(xpath); string author = "USER-"; XElement xe = (from db in doc.Element(ns + "Page").Elements(ns + "Outline") where db.Attribute("author").Value == author select db).Single() as XElement; try { xe.Remove(); doc.Save(xpath); } catch { } } #region OCR寫入Onenote和生成文字整個過程 //string xpath = @"C:\Users\Administrator\Desktop\OCR_Onenote\OnenoteOCR2.1\tmp.xml"; private void fnOCR(string v_strImgPath) { ORC(v_strImgPath); } public void ORC(string v_strImgPath) { FileInfo file = new FileInfo(v_strImgPath); #region //獲取圖片的Base64編碼 using (MemoryStream ms = new MemoryStream()) { Bitmap bp = new Bitmap(v_strImgPath); switch (file.Extension.ToLower()) { case ".jpg": bp.Save(ms, ImageFormat.Jpeg); break; case ".jpeg": bp.Save(ms, ImageFormat.Jpeg); break; case ".gif": bp.Save(ms, ImageFormat.Gif); break; case ".bmp": bp.Save(ms, ImageFormat.Bmp); break; case ".tiff": bp.Save(ms, ImageFormat.Tiff); break; case ".png": bp.Save(ms, ImageFormat.Png); break; case ".emf": bp.Save(ms, ImageFormat.Emf); break; default: this.labMsg.Content = "不支援的圖片格式。"; return; } byte[] buffer = ms.GetBuffer(); string _Base64 = Convert.ToBase64String(buffer); #endregion //向Onenote2010中插入圖片 var onenoteApp = new Microsoft.Office.Interop.OneNote.Application(); //onenote提供的API /***************************************************************************************/ string sectionID; onenoteApp.OpenHierarchy(@"C:\Users\Administrator\Documents\OneNote 筆記本\個人\newfile.one", null, out sectionID, Microsoft.Office.Interop.OneNote.CreateFileType.cftSection); string pageID = "{A975EE72-19C3-4C80-9C0E-EDA576DAB5C6}{1}{B0}"; onenoteApp.CreateNewPage(sectionID, out pageID, Microsoft.Office.Interop.OneNote.NewPageStyle.npsBlankPageNoTitle); /********************************************************************************/ string notebookXml; onenoteApp.GetHierarchy(null, Microsoft.Office.Interop.OneNote.HierarchyScope.hsPages, out notebookXml); var doc = XDocument.Parse(notebookXml); var ns = doc.Root.Name.Namespace; var pageNode = doc.Descendants(ns + "Page").FirstOrDefault(); var existingPageId = pageNode.Attribute("ID").Value; #region if (pageNode != null) { //Image Type 只支援這些型別:auto|png|emf|jpg string ImgExtension = file.Extension.ToLower().Substring(1); switch (ImgExtension) { case "jpg": ImgExtension = "jpg"; break; case "png": ImgExtension = "png"; break; case "emf": ImgExtension = "emf"; break; default: ImgExtension = "auto"; break; } #endregion var page = new XDocument(new XElement(ns + "Page", new XElement(ns + "Outline", new XElement(ns + "OEChildren", new XElement(ns + "OE", new XElement(ns + "Image", new XAttribute("format", ImgExtension), new XAttribute("originalPageNumber", "0"), new XElement(ns + "Position", new XAttribute("x", "0"), new XAttribute("y", "0"), new XAttribute("z", "0")), new XElement(ns + "Size", new XAttribute("width", bp.Width.ToString()), new XAttribute("height", bp.Height.ToString())), new XElement(ns + "Data", _Base64))))))); page.Root.SetAttributeValue("ID", existingPageId); //儲存圖片進入Onenote頁面 //注意以下幾點:(待解決) //1,onenote頁面自動會生成一個頁面,可能造成一直ocr錯誤。刪除預設頁面,新建空頁 //2,圖片儲存在新建頁面中,通過如下程式碼實現的,以追加儲存方式進行。 onenoteApp.UpdatePageContent(page.ToString(), DateTime.MinValue); //執行緒休眠時間,單位毫秒,若圖片很大,則延長休眠時間,保證Onenote OCR完畢 System.Threading.Thread.Sleep(Int32.Parse(System.Configuration.ConfigurationManager.AppSettings["WaitTIme"])); string pageXml; onenoteApp.GetPageContent(existingPageId, out pageXml, Microsoft.Office.Interop.OneNote.PageInfo.piBinaryData); //獲取OCR後的內容 FileStream tmpXml = new FileStream(System.Configuration.ConfigurationManager.AppSettings["tmpPath"] + @"\tmp.xml", FileMode.Create, FileAccess.ReadWrite); StreamWriter sw = new StreamWriter(tmpXml); sw.Write(pageXml); sw.Flush(); sw.Close(); tmpXml.Close(); //載入xml中的資料 FileStream tmpOnenote = new FileStream(System.Configuration.ConfigurationManager.AppSettings["tmpPath"] + @"\tmp.xml", FileMode.Open, FileAccess.ReadWrite); XmlReader reader = XmlReader.Create(tmpOnenote); XElement rdlc = XElement.Load(reader); // rdlc.Save(xpath); /*****************************************************************************************************/ XmlNameTable nameTable = reader.NameTable; XmlNamespaceManager mgr = new XmlNamespaceManager(nameTable); mgr.AddNamespace("one", ns.ToString()); StringReader sr = new StringReader(pageXml); XElement onenote = XElement.Load(sr); ////讀取xml中資料,並儲存到文字中。 //XDocument doc1 = XDocument.Load(xpath); var xml = from o in onenote.XPathSelectElements("//one:Image", mgr) select o.XPathSelectElement("//one:OCRText", mgr).Value; this.txtOCRed.Text = xml.First().ToString(); /**********************************************************************/ sr.Close(); reader.Close(); tmpOnenote.Close(); //DeleteXML(xpath); onenoteApp.DeleteHierarchy(existingPageId); //onenoteApp.DeletePageContent(existingPageId, "{242BE490-7BF9-43D5-B719-3999E7631259}{46}{B0}"); //onenoteApp.DeletePageContent(existingPageId, "{242BE490-7BF9-43D5-B719-3999E7631259}{50}{B0}"); } } } #endregion #endregion #endregion #region 系統事件 #region 搜尋資料夾中的檔案:2014-7-10 17:12:57 //搜尋資料夾中的檔案 //時間:2014-7-10 14:54:44 //作者:白寧超 ArrayList GetAll(DirectoryInfo dir) { try { ArrayList FileList = new ArrayList();//定義陣列存放圖片檔名 FileInfo[] allFile = dir.GetFiles(); foreach (FileInfo fi in allFile) { FileList.Add(fi.Name);//遍歷圖片,並新增到陣列 } DirectoryInfo[] allDir = dir.GetDirectories(); foreach (DirectoryInfo d in allDir) { GetAll(d); } return FileList; } catch (Exception e) { labMsg.Content = e.Message + "資料夾選擇方式錯誤,重新選擇!!"; return null; } } #endregion #region 選擇遍歷資料夾圖片 //檔案中選擇所有檔案處理 //時間:2014-7-10 14:54:44 //作者:白寧超 private void btn瀏覽_Click(object sender, RoutedEventArgs e) { txtmulu.Text = null; FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.Description = "請選擇待處理目錄"; if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string foldPath = dialog.SelectedPath; txtfile.Text = foldPath; DirectoryInfo d = new DirectoryInfo(@txtfile.Text); ArrayList Flst = GetAll(d); foreach (object o in Flst) { txtmulu.Text += "正在ORC圖片: 【" + o.ToString() + "】\r\n"; } } else { labMsg.Content = "開啟失敗!!"; } #region 上傳單個圖片 2014-7-10 15:34:17 /*OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "請選擇一個本地圖片"; ofd.Multiselect = false; ofd.Filter = "支援的圖片格式(*.jpg,*.jpeg,*.gif,*.bmp,*.png,*.tiff,*.emf)|*.jpg;*.jpeg;*.gif;*.bmp;*.png;*.tiff;*.emf"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.txt本地圖片.Text = ofd.FileName; this.img圖片.Source = new BitmapImage(new Uri(ofd.FileName, UriKind.RelativeOrAbsolute)); this.labMsg.Content = "本地圖片已成功載入。"; }*/ #endregion } #endregion #region 選擇本地圖片OCR轉化 private void rbtn本地圖片_Checked(object sender, RoutedEventArgs e) { if (this.IsInitialized) { if ((bool)this.rbtn本地圖片.IsChecked) { this.txtfile.Text = string.Empty; this.txtfile.IsEnabled = true; this.btn瀏覽.IsEnabled = true; this.txtfile.Focus(); this.txtmulu.Text = null; } } } #endregion #region 選擇需要輸入處理的檔案 private void btn瀏覽_Click_1(object sender, RoutedEventArgs e) { txtmulu.Text = null; FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.Description = "請選擇待處理目錄"; if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string foldPath = dialog.SelectedPath; txtfile.Text = foldPath; DirectoryInfo d = new DirectoryInfo(@txtfile.Text); ArrayList Flst = GetAll(d); foreach (object o in Flst) { txtmulu.Text += "正在ORC圖片: 【" + o.ToString() + "】\r\n"; } } else { labMsg.Content = "開啟失敗!!"; } #region 上傳單個圖片 2014-7-10 15:34:17 /*OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "請選擇一個本地圖片"; ofd.Multiselect = false; ofd.Filter = "支援的圖片格式(*.jpg,*.jpeg,*.gif,*.bmp,*.png,*.tiff,*.emf)|*.jpg;*.jpeg;*.gif;*.bmp;*.png;*.tiff;*.emf"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.txt本地圖片.Text = ofd.FileName; this.img圖片.Source = new BitmapImage(new Uri(ofd.FileName, UriKind.RelativeOrAbsolute)); this.labMsg.Content = "本地圖片已成功載入。"; }*/ #endregion } #endregion #region 選擇輸出資料夾 private void btn輸出瀏覽_Click(object sender, RoutedEventArgs e) { FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd.Description = "請選擇一個輸出目錄"; if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.txt輸出目錄.Text = fbd.SelectedPath; DelFillOrDir(this.txt輸出目錄.Text); } } #endregion #region 清空輸出檔案 private void btn清空_Click(object sender, RoutedEventArgs e) { OCRtxt.Text = ""; this.OCRtxt.Focus(); } #endregion #region ORC轉化過程 private void btnOCR_Click(object sender, RoutedEventArgs e) { if (this.fn資料驗證()) { OCRtxt.Text = ""; return; } try { DirectoryInfo dir = new DirectoryInfo(this.txt輸出目錄.Text); if ((bool)this.rbtn本地圖片.IsChecked) { List<string> imgpath = GetImgPath(@txtfile.Text);//獲取圖片列表 //定義進度條預設值 pb_import.Minimum = 0; pb_import.Maximum = imgpath.Count(); double i = 0; txtOCRed.Text = ""; OCRtxt.Text += "******************************************************************************"; foreach (object img in imgpath) { this.fnOCR(img.ToString());//遍歷處理圖片orc FileInfo file = new FileInfo(img.ToString()); string name = file.Name.Substring(0, file.Name.LastIndexOf(".")); this.__OutputFileName = dir.FullName + @"\" + name + ".txt"; FileStream fs = new FileStream(this.__OutputFileName, FileMode.Create, FileAccess.ReadWrite); StreamWriter sw = new StreamWriter(fs); sw.Write(this.txtOCRed.Text);//將this.txtOCRed.Text內容寫進txt檔案中 sw.Flush(); sw.Close(); fs.Close(); OCRtxt.Text += "成功ORC出: 【" + name + ".txt】" + "\r\n"; //回撥UI進度顯示 i++; pb_import.Value = i; UpdateProgressBarDelegate updatePbDelegate = new UpdateProgressBarDelegate(pb_import.SetValue); Dispatcher.Invoke(updatePbDelegate, System.Windows.Threading.DispatcherPriority.Background, new object[] { System.Windows.Controls.ProgressBar.ValueProperty, Convert.ToDouble(i + 1) }); Thread.Sleep(1000); } } if (pb_import.Value == pb_import.Maximum) { System.Windows.Forms.MessageBox.Show("資料轉換完成。"); } else { System.Windows.Forms.MessageBox.Show("資料轉換失敗。"); } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("資料轉換失敗:" + ex.Message + ex.StackTrace); this.labMsg.Content = "OCR失敗。"; } finally { //System.Threading.Thread.CurrentThread.Abort(); Thread.Sleep(3000); } } #endregion #region//窗體關閉 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { DirectoryInfo dir = new DirectoryInfo(System.Configuration.ConfigurationManager.AppSettings["tmpPath"]); foreach (FileInfo file in dir.GetFiles()) { file.Delete(); } } #endregion #endregion } }
View Code

功能以及操作描述:

  1. 執行本頁面如上圖,然後通過選擇待處理目錄(含中文文字圖片),和輸出目錄,點選ORC即可。
  2. 在待處理目錄下,點選瀏覽按鈕,然後選擇相應的資料夾,後臺通過判斷資料夾是否存在,如果存在進行遍歷,讀取出所有圖片,然後在本頁左端文字框對圖片進行顯示。
  3. 然後選擇輸出目錄中的瀏覽按鈕,選擇處理後的結果存放資料夾,此項必填。否則不執行。在每次操作瀏覽按鈕時,會對選擇的資料夾進行清空處理,這樣下次操作保持乾淨資料。
  4. 完成以上步驟,可以進行ORC操作,操作過程中通過遍歷資料夾中圖片檔案,在一個方面中開啟OneNote介面,對圖片進行處理。圖片處理生成的是一個xml檔案,此檔案不可視,一個快取的xml檔案,隨著程式結束而終止,在處理過程中通過程式碼解析快取xml,將文字資料提取到一個txt檔案中。同時沒執行一張圖片,如圖左邊列印成功執行的檔案,同時進度條滾動,結束後進行提示。
  5. 最後開啟對應資料夾裡面顯示生產資料與對應圖片保持一致。規範字體識別率還是可以的

所遇問題以及瓶頸突破:

  1. 在描述難點之前,我還是先提取出核心ORC程式碼,下面再做以概述。遍歷處理圖片
   
  #region
                    foreach (object img in imgpath)
                    {
                        this.fnOCR(img.ToString());//遍歷處理圖片orc
                        FileInfo file = new FileInfo(img.ToString());
                        string name = file.Name.Substring(
            
           

相關推薦

基於WPF+OneNote+Oracle中文圖片識別系統階段總結基於OneNote難點突破批量識別

【小記】:大膽嘗試才能突破,某個中醫藥大學有一批圖片需要處理(ORC),然後進行資料探勘。之前沒有接觸過ORC這個東西,但是還是應允了。在網上搜索一番,關於中文圖片識別,最終敲定為基於微軟的OneNote,其識別率相對較高。網上這個技術點的資料真心不多,後來於部落格園找到一篇博文,但是那個

基於WPF+OneNote+Oracle中文圖片識別系統階段總結關於OneNote入庫處理以及稽核

namespace OnenoteOCRDemo { /// <summary> /// falg.xaml 的互動邏輯 /// </summary> public partial class falg : Window {

基於WPF+OneNote+Oracle中文圖片識別系統階段總結WPF常用知識以及本專案設計總結

【小記】:大膽嘗試才能突破,某個中醫藥大學有一批圖片需要處理(ORC),然後進行資料探勘。之前沒有接觸過ORC這個東西,但是還是應允了。在網上搜索一番,關於中文圖片識別,最終敲定為基於微軟的OneNote,其識別率相對較高。網上這個技術點的資料真心不多,後來於部落格園找到一篇博文,但是那個

基於WPF+OneNote+Oracle中文圖片識別系統階段總結批量處理後的txt檔案入庫處理

【小記】:大膽嘗試才能突破,某個中醫藥大學有一批圖片需要處理(ORC),然後進行資料探勘。之前沒有接觸過ORC這個東西,但是還是應允了。在網上搜索一番,關於中文圖片識別,最終敲定為基於微軟的OneNote,其識別率相對較高。網上這個技術點的資料真心不多,後來於部落格園找到一篇博文,但是那個

基於WinForm+Access區域網共享資料庫的專案總結Access遠端連線資料庫窗體打包部署

【小記】:最近基於WinForm+Access資料庫完成一個法律諮詢管理系統。本系統要求類似網頁後臺管理效果,並且基於區域網內,完成多客戶端操作同一資料庫,根據許可權不同分別執行不同功能模組。核心模組為級聯統計型別管理、資料庫諮詢資料扇形統計、樹的操作、諮詢資料的管理、手寫分頁、Excel資料

基於WinForm+Access區域網共享資料庫的專案總結WinForm開發扇形圖統計Excel資料匯出

【小記】:最近基於WinForm+Access資料庫完成一個法律諮詢管理系統。本系統要求類似網頁後臺管理效果,並且基於區域網內,完成多客戶端操作同一資料庫,根據許可權不同分別執行不同功能模組。核心模組為級聯統計型別管理、資料庫諮詢資料扇形統計、樹的操作、諮詢資料的管理、手寫分頁、Excel資料

基於WinForm+Access區域網共享資料庫的專案總結WinForm開發總體概述與技術實現

【小記】:最近基於WinForm+Access資料庫完成一個法律諮詢管理系統。本系統要求類似網頁後臺管理效果,並且基於區域網內,完成多客戶端操作同一資料庫,根據許可權不同分別執行不同功能模組。核心模組為級聯統計型別管理、資料庫諮詢資料扇形統計、樹的操作、諮詢資料的管理、手寫分頁、Excel資料

Java並發編程線程間通信中notifyAll造成的早期通知問題(含代碼)

data light lan 添加項 article util tool 元素 seconds 轉載請註明出處:http://blog.csdn.net/ns_code/article/details/17229601 如果線程在等待時接到通知,但線程等待的條件

NLPPython實例基於文本相似度對申報項目進行查重設計

用戶 strip() 字符串 執行 原創 這樣的 string 得到 亂碼問題 Python實例:申報項目查重系統設計與實現 作者:白寧超 2017年5月18日17:51:37 摘要:關於查重系統很多人並不陌生,無論本科還是碩博畢業都不可避免涉及論文查重問題,這也

DLAttention-ED基於TF NMT利用帶有Attention的 ED模型訓練、測試(中英文平行語料庫)實現將英文翻譯為中文的LSTM翻譯模型過程全記錄

DL之Attention-ED:基於TF NMT利用帶有Attention的 ED模型訓練(中英文平行語料庫)實現將英文翻譯為中文的LSTM翻譯模型過程全記錄 測試輸出結果     模型監控 1、SCALARS clipp

NLP情感分析基於python程式設計(jieba庫)實現中文文字情感分析(得到的是情感評分)

NLP之情感分析:基於python程式設計(jieba庫)實現中文文字情感分析(得到的是情感評分) 輸出結果 1、測試物件 data1= '今天上海的天氣真好!我的心情非常高興!如果去旅遊的話我會非常興奮!和你一起去旅遊我會更加幸福!' data2= '今天上海天氣真差,非常討厭下雨,把

Machine Learning決策樹案例基於python的商品購買能力預測系統

作者:白寧超 2016年12月24日22:05:42 摘要:隨著機器學習和深度學習的熱潮,各種圖書層出不窮。然而多數是基礎理論知識介紹,缺乏實現的深入理解。本系列文章是作者結合視訊學習和書籍基礎的筆記所得。本系列文章將採用理論結合實踐方式編寫。首先介紹機器學習和深度學習的範疇,然後介紹關於訓練集、

ZYNQ_LINUX使用問題02WIN10 安裝 VMWARE 中不能識別SD卡

安裝好vmware12 和 ubbuntu 12後,想用ubuntu 給SD 卡做分割槽,發現ubuntu 下不能識別到SD 卡和U盤,使用 fdisk -l 命令也查詢不到 問題解決參考: 也許你的問題並不需要做下面的設定,只需要在控制面板裡對VM 進行修復即可。 我的

AI實戰手把手教你文字識別(檢測AdvancedEAST、PixelLink方法)

  自然場景下的文字檢測是深度學習的重要應用,在之前的文章中已經介紹過了在簡單場景、複雜場景下的文字檢測方法,包括MSE

Java並發編程十八第五中volatile意外問題的正確分析解答(含代碼)

深入 規則 rup lis con method 執行 change .text 轉載請註明出處:http://blog.csdn.net/ns_code/article/details/17382679 在《Java並發編程學習筆記之五:volatile變量修

Java並發編程十六深入Java內存模型——happen-before規則及其對DCL的分析(含代碼)

無需 bit 對象引用 說了 final 緩存 機器 通過 round 轉載請註明出處:http://blog.csdn.net/ns_code/article/details/17348313 happen—before規則介紹 Java語言中有一個“先行發生

Java並發編程十九並發新特性—Executor框架與線程池(含代碼)

接口類 容易 20px 了解 大小 執行c 生命周期 schedule p s Executor框架簡介 在Java 5之後,並發編程引入了一堆新的啟動、調度和管理線程的API。Executor框架便是Java 5中引入的,其內部使用了線程池機制,它在java.

Java並發編程十一線程間通信中notify通知的遺漏(含代碼)

key wait title net fill article 返回 0ms 註意 轉載請註明出處:http://blog.csdn.net/ns_code/article/details/17228213 notify通知的遺漏很容易理解,即threadA還沒

Java並發編程十七深入Java內存模型—內存操作規則總結

tle 沒有 article 類型 javase 感知 執行引擎 要求 lock 轉載請註明出處:http://blog.csdn.net/ns_code/article/details/17377197 主內存與工作內存 Java內存模型的主要目標是定義程序中

Java並發編程十四圖文講述同步的另一個重要功能內存可見性

integer sdn 技術 訪問 span 另一個 edi int tro 轉載請註明出處:http://blog.csdn.net/ns_code/article/details/17288243 加鎖(synchronized同步)的功能不僅僅局限於互斥