ibatra / bert-keyword-extractor Goto Github PK
View Code? Open in Web Editor NEWDeep Keyphrase Extraction using BERT
Deep Keyphrase Extraction using BERT
The convert Function that converts the phrases into B,H I tokens is not valid for repeated words in a keyphrase. As the function is made they will take the first occurance of the word and not the desired word in case of repetation.
Do you have a pre-trained model that we can use for a downstream system? It would be awesome if you can provide us with that!
Why using the flat_accuracy
function, instand of the accuracy_score provied by seqeval package?
I am going to use BERT-based Keyword Extraction. But MAX_LENGTH config is set to 75, so is it okay to change this value? As far as I know, BERT has a MAX input length of 512, but I would like to ask you how to solve it if you want to put a much longer input.
argparse module not imported
i m really insipired by #6
but i m wondering even absent multiple keywords from paragraph?
Can the model be used to extract keyword from a paragraph, that consists of several sentences? Thank you.
RuntimeError: index out of range at /pytorch/aten/src/TH/generic/THTensorEvenMoreMath.cpp:191
Hello Sir,
can we use it for topic detection from a set of documents?
如题……
Can I use the fine-tuned model to extract keywords from any .txt file if I don't have the keys?
Running the repository without any modifications and getting the following error? Does anyone know how to fix this?
TypeError Traceback (most recent call last)
in
58 pred_tags = [tags_vals[p_i] for p in predictions for p_i in p]
59 valid_tags = [tags_vals[l_ii] for l in true_labels for l_i in l for l_ii in l_i]
---> 60 print("F1-Score: {}".format(f1_score(pred_tags, valid_tags)))
~/miniconda3/lib/python3.8/site-packages/seqeval/metrics/sequence_labeling.py in f1_score(y_true, y_pred, average, suffix, mode, sample_weight, zero_division, scheme)
357 suffix=suffix)
358 else:
--> 359 _, _, f, _ = precision_recall_fscore_support(y_true, y_pred,
360 average=average,
361 warn_for=('f-score',),
~/miniconda3/lib/python3.8/site-packages/seqeval/metrics/sequence_labeling.py in precision_recall_fscore_support(y_true, y_pred, average, warn_for, beta, sample_weight, zero_division, suffix)
128 return pred_sum, tp_sum, true_sum
129
--> 130 precision, recall, f_score, true_sum = _precision_recall_fscore_support(
131 y_true, y_pred,
132 average=average,
~/miniconda3/lib/python3.8/site-packages/seqeval/metrics/v1.py in _precision_recall_fscore_support(y_true, y_pred, average, warn_for, beta, sample_weight, zero_division, scheme, suffix, extract_tp_actual_correct)
120 raise ValueError('average has to be one of {}'.format(average_options))
121
--> 122 check_consistent_length(y_true, y_pred)
123
124 pred_sum, tp_sum, true_sum = extract_tp_actual_correct(y_true, y_pred, suffix, scheme)
~/miniconda3/lib/python3.8/site-packages/seqeval/metrics/v1.py in check_consistent_length(y_true, y_pred)
95 is_list = set(map(type, y_true)) | set(map(type, y_pred))
96 if not is_list == {list}:
---> 97 raise TypeError('Found input variables without list of list.')
98
99 if len(y_true) != len(y_pred) or len_true != len_pred:
TypeError: Found input variables without list of list.
I get some errors while running the code, some packages are not imported. There are some other error that may be fixed but I did not go through the details. Ishaan, would you update your code?
I have a requirement were I need to extract more than one keyword from the sentence. Is it possible to do with just passing the text of interest once?
Example:
Input text: "I don't like this coffee because it's too sweet after having it for few days I don't like it anymore"
Output keywords: "too sweet" and "don't like it".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.