Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            if (Environment.OSVersion.Platform == System.PlatformID.Unix)
            {
                //静态变量已经定下来了,这里改不来了!
                Console.WriteLine("Switch Doc Path To:" + DocBase);
            }
            //日志
            Logger = new StreamWriter("Log.log");
            //实体属性器日志设定
            EntityProperty.Logger = Logger;
            //全局编码
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

            CIRecord = new StreamWriter("CI.log");

            QuickTestArea(); return;

            //PDFToTXT.GetPdf2TxtBatchFile();

            //公司全称简称曾用名字典
            CompanyNameLogic.LoadCompanyName("Resources" + Path.DirectorySeparatorChar + "FDDC_announcements_company_name_20180531.json");
            //结巴分词的地名修正词典
            PosNS.ImportNS("Resources" + Path.DirectorySeparatorChar + "ns.dict");
            //预处理
            Traning();
            Evaluator = new StreamWriter("Evaluator.log");
            Score     = new StreamWriter("Result" + Path.DirectorySeparatorChar + "Score" + Path.DirectorySeparatorChar + "score" + System.DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt");
            Extract();
            CIRecord.Close();
            Score.Close();
            Evaluator.Close();
            Logger.Close();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Logger = new StreamWriter("Log.log");
            //全局编码
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

            //公司全称简称曾用名字典
            CompanyNameLogic.LoadCompanyName(@"Resources" + Path.DirectorySeparatorChar + "FDDC_announcements_company_name_20180531.json");
            //增减持公告日期的读入
            StockChange.ImportPublishTime();
            //结巴分词的地名修正词典
            PosNS.ImportNS(@"Resources" + Path.DirectorySeparatorChar + "ns.dict");
            CIRecord = new StreamWriter("CI.log");
            //预处理
            Traning(); return;

            Evaluator = new StreamWriter("Evaluator.log");
            Score     = new StreamWriter(@"Result" + Path.DirectorySeparatorChar + "Score" + Path.DirectorySeparatorChar + "score" + System.DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt");
            //new Contract(Program.DocBase + @"\FDDC_announcements_round1_train_20180518\round1_train_20180518\重大合同\html\1008828.html").Extract();return;
            Extract();
            CIRecord.Close();
            Score.Close();
            Evaluator.Close();
            Logger.Close();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 最后用抽取
        /// </summary>
        static void Main_FINAL(string[] args)
        {
            Logger = new StreamWriter("Log.log");
            //实体属性器日志设定
            EntityProperty.Logger = Logger;
            //全局编码
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            //结巴分词的地名修正词典
            PosNS.ImportNS("Resources" + Path.DirectorySeparatorChar + "ns.dict");

            if (!Directory.Exists("/home/118_4/submit"))
            {
                Directory.CreateDirectory("/home/118_4/submit");
            }
            Console.WriteLine("Start To Extract Info Contract TRAIN");
            StreamWriter ResultCSV = new StreamWriter(@"/home/118_4/submit/hetong.txt", false, utf8WithoutBom);

            Run <Contract>(@"/home/data/hetong", @"/home/118_4/temp/hetong", ResultCSV);
            Console.WriteLine("Complete Extract Info Contract");

            Console.WriteLine("Start To Extract Info StockChange TRAIN");
            Console.WriteLine("读取增减持信息:" + "/home/data/zengjianchi/zengjianchi_public.csv");

            var sr = new StreamReader("/home/data/zengjianchi/zengjianchi_public.csv");

            sr.ReadLine();  //Skip Header
            while (!sr.EndOfStream)
            {
                var line        = sr.ReadLine().Split(",");
                var numbers     = RegularTool.GetNumberList(line[0]);
                int year        = int.Parse(numbers[0]);
                int month       = int.Parse(numbers[1]);
                int day         = int.Parse(numbers[2]);
                var AnnouceDate = new DateTime(year, month, day);
                PublishTime.Add(line[1], AnnouceDate);
                //Console.WriteLine("ID:" + line[1] + " Date:" + AnnouceDate.ToString("yyyy-MM-dd"));
            }
            sr.Close();
            Console.WriteLine("读取增减持信息:" + PublishTime.Count);

            ResultCSV = new StreamWriter(@"/home/118_4/submit/zengjianchi.txt", false, utf8WithoutBom);
            Run <StockChange>(@"/home/data/zengjianchi", @"/home/118_4/temp/zengjianchi", ResultCSV);
            Console.WriteLine("Complete Extract Info StockChange");

            Console.WriteLine("Start To Extract Info Reorganization TRAIN");
            //替代训练结果
            Console.WriteLine("加载替代训练结果");
            ReOrganizationTraning.EvaluateMethodList = new string[] {
                "收益法", "资产基础法", "市场法", "市场比较法", "估值法", "成本法", "现金流折现法", "现金流折现法", "剩余法",
                "内含价值调整法", "可比公司市净率法", "重置成本法", "收益现值法", "基础资产法", "假设清偿法",
                "成本逼近法", "单项资产加和法", "成本加和法", "基准地价修正法", "收益还原法", "现金流量法", "单项资产加总法", "折现现金流量法", "基准地价系数修正法"
            }.ToList();
            Console.WriteLine("加载替代训练结果:" + ReOrganizationTraning.EvaluateMethodList.Count);
            ResultCSV = new StreamWriter(@"/home/118_4/submit/chongzu.txt", false, utf8WithoutBom);
            Run <Reorganization>(@"/home/data/chongzu", "", ResultCSV);
            Console.WriteLine("Complete Extract Info Reorganization");

            Logger.Close();
        }
Ejemplo n.º 4
0
 private static void GetBatchFile()
 {
     //地名修正词典的获取
     PosNS.ExtractNsFromDP();
     //PDFMiner:PDF转TXTbatch
     PDFToTXT.GetPdf2TxtBatchFile();
     //TXT整理
     PDFToTXT.FormatTxtFile();
     //LTP:XML生成Batch
     PDFToTXT.GetLTPXMLBatchFile();
 }