Exemplo n.º 1
0
        /// <summary>
        /// 快速测试区
        /// </summary>
        private static void QuickTestArea()
        {
            var t = new Reorganization();

            t.Init(ReorganizationPath_TEST + "/html/18283582.html");
            t.Extract();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 快速测试区
        /// </summary>
        private static void QuickTestArea()
        {
            var plst = LTPTrainingNER.GetParagraghList(StockChangePath_TEST + "/ner/18877033.xml");

            CompanyNameLogic.GetCompanyNameByNerInfo(plst);
            return;

            var s0    = "爱康科技向爱康实业、爱康国际、苏州度金、天地国际、钨业研究支付现金购买其合计持有爱康光电100%股权";
            var pos   = new PosSegmenter();
            var words = pos.Cut(s0);

            Evaluator = new StreamWriter("Evaluator.log");
            Score     = new StreamWriter("Result" + Path.DirectorySeparatorChar + "Score" + Path.DirectorySeparatorChar + "score" + System.DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt");
            //Evaluate.EvaluateReorganizationByFile(@"E:\WorkSpace2018\FDDC2018\FDDC_SRC\Result\chongzu_train.txt");
            //Score.Close();
            //Evaluator.Close();

            //TraningDataset.InitReorganization();
            ReOrganizationTraning.EvaluateMethodList = new string[] {
                "收益法", "资产基础法", "市场法", "市场比较法", "估值法", "成本法", "现金流折现法", "现金流折现法", "剩余法",
                "内含价值调整法", "可比公司市净率法", "重置成本法", "收益现值法", "基础资产法", "假设清偿法",
                "成本逼近法", "单项资产加和法", "成本加和法", "基准地价修正法", "收益还原法", "现金流量法", "单项资产加总法", "折现现金流量法", "基准地价系数修正法"
            }.ToList();
            var t = new Reorganization();

            t.Id           = "748379";
            t.HTMLFileName = ReorganizationPath_TEST + "/html/1759374.html";
            //t.TextFileName = ContractPath_TEST + "/txt/128869.txt";
            //t.NerXMLFileName = ContractPath_TEST + "/ner/128869.xml";
            t.Init();
            var recs = t.Extract();
            var s1   = recs[0].ConvertToString();
        }
Exemplo n.º 3
0
    public static void GetTradeCompanyFromReplaceTable(int TraningCnt = int.MaxValue)
    {
        var TargetDict  = new Dictionary <string, int>();
        var PreviewId   = String.Empty;
        var PreviewRoot = new Reorganization();
        int Cnt         = 0;

        foreach (var ReOrg in TraningDataset.ReorganizationList)
        {
            if (!PreviewId.Equals(ReOrg.Id))
            {
                var htmlfile = Program.ReorganizationPath_TRAIN + @"\html\" + ReOrg.Id + ".html";
                if (!System.IO.File.Exists(htmlfile))
                {
                    continue;
                }
                PreviewRoot = new Reorganization();
                PreviewRoot.Init(htmlfile);
                PreviewId = ReOrg.Id;
                Cnt++; if (Cnt == TraningCnt)
                {
                    break;
                }
            }
            foreach (var item in PreviewRoot.ExplainDict)
            {
                var values = item.Value;
                if (values.Contains(ReOrg.Target) && values.Contains(ReOrg.TargetCompany))
                {
                    var keys  = item.Key.Split(Utility.SplitChar);
                    var keys2 = item.Key.Split("/");
                    if (keys.Length == 1 && keys2.Length > 1)
                    {
                        keys = keys2;
                    }
                    foreach (var key in keys)
                    {
                        if (!TargetDict.ContainsKey(key))
                        {
                            TargetDict.Add(key, 1);
                        }
                        else
                        {
                            TargetDict[key] += 1;
                        }
                    }
                }
            }
        }

        var rank = Utility.FindTop(10, TargetDict);

        Program.Training.WriteLine("交易对象");
        foreach (var rec in rank)
        {
            Program.Training.WriteLine(rec.ToString());
        }
    }