Coder Social home page Coder Social logo

zhihan1996 / tradetheevent Goto Github PK

View Code? Open in Web Editor NEW
93.0 2.0 22.0 5.4 MB

Implementation of "Trade the Event: Corporate Events Detection for News-Based Event-Driven Trading." In Findings of ACL2021

Python 100.00%
event-driven-trading stock-prediction stock-price-prediction dataset event-detection news trade corporate-event acl stock-market

tradetheevent's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tradetheevent's Issues

I get an error that train.txt isn't found

Traceback (most recent call last): File "run_domainadapt.py", line 300, in <module> main() File "run_domainadapt.py", line 229, in main get_dataset(data_args, tokenizer=tokenizer, cache_dir=model_args.cache_dir) if training_args.do_train else None File "run_domainadapt.py", line 125, in get_dataset return TextDataset( File "/Users/test/Downloads/TradeTheEvent-main/venv/lib/python3.8/site-packages/transformers/data/datasets/language_modeling.py", line 30, in __init__ assert os.path.isfile(file_path), f"Input file path {file_path} not found" AssertionError: Input file path DIR_TO_EDT_DATASET/Domain_adaptation/train.txt not found
Do i have to download additional files for this project from somewhere or why do I get this error

I get an error when running run_domainadapt.py

I use the command exactly like in the documentation.
The error I get I the following:
zsh: illegal hardware instruction python run_domainadapt.py --output_dir=ADA_MODEL_DIR --model_type=bert
What can I do

I got the error when I run run_event.py

Traceback (most recent call last):
File "run_event.py", line 489, in
main()
File "run_event.py", line 463, in main
outputs = model(input_ids, attention_mask=attention_mask, seq_labels=seq_labels, ner_labels=ner_labels)
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 167, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 177, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 86, in parallel_apply
output.reraise()
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/_utils.py", line 429, in reraise
raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in replica 0 on device 0.
Original Traceback (most recent call last):
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 61, in _worker
output = module(*input, **kwargs)
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/data1/lht/TradeTheEvent/utils/model.py", line 170, in forward
seq_logits = self.final_classifier1(seq_logits)
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 94, in forward
return F.linear(input, self.weight, self.bias)
File "/data1/lht/anaconda3/envs/tte/lib/python3.7/site-packages/torch/nn/functional.py", line 1753, in linear
return torch._C._nn.linear(input, weight, bias)
RuntimeError: mat1 dim 1 must match mat2 dim 0

Is the error caused by networks, or the version of torch is not valid?

new complementary tool

My name is Luis, I'm a big-data machine-learning developer, I'm a fan of your work, and I usually check your updates.

I was afraid that my savings would be eaten by inflation. I have created a powerful tool that based on past technical patterns (volatility, moving averages, statistics, trends, candlesticks, support and resistance, stock index indicators).
All the ones you know (RSI, MACD, STOCH, Bolinger Bands, SMA, DEMARK, Japanese candlesticks, ichimoku, fibonacci, williansR, balance of power, murrey math, etc) and more than 200 others.

The tool creates prediction models of correct trading points (buy signal and sell signal, every stock is good traded in time and direction).
For this I have used big data tools like pandas python, stock market libraries like: tablib, TAcharts ,pandas_ta... For data collection and calculation.
And powerful machine-learning libraries such as: Sklearn.RandomForest , Sklearn.GradientBoosting, XGBoost, Google TensorFlow and Google TensorFlow LSTM.

With the models trained with the selection of the best technical indicators, the tool is able to predict trading points (where to buy, where to sell) and send real-time alerts to Telegram or Mail. The points are calculated based on the learning of the correct trading points of the last 2 years (including the change to bear market after the rate hike).

I think it could be useful to you, to improve, I would like to share it with you, and if you are interested in improving and collaborating I am also willing, and if not file it in the box.

Asking for the Ave return formular

I run your backtest, and there was ave return result. I would like to ask how can I get his result, could you upload the full code for this part? Thanks~

'BertConfig' object has no attribute 'max_seq_length'

thank you for such great work!!
I ran

python run_event.py --TASK bilevel --data_dir ./data/Event_detection --epoch 5 --model_type models/bert_bc_adapted --output_dir models/bilevel --bert_lr 5e-5 --per_gpu_batch_size 8 --gradient_accumulation_steps 1 --max_seq_length 256

I got the following error

'BertConfig' object has no attribute 'max_seq_length'

Adding the "model_max_length": 256 attribute in the config file models/bert_bc_adapted can be a solution.

Would you please make a modification to the code and commit?
Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.