Comments (8)
Hi @Uotas
If I understand correctly, the problem seems to be that there are no gold references within the keyphrase candidates. The issue may come from the candidate selection method that you use, you can try to extract n-grams instead. You should also check if the references actually occur in the document.
Florian
from pke.
Hi @boudinfl
Yes, that's my problem.
I try to extract n-grams but it doesn't work and I could know that about 15% gold keyphrases don't appear in the text in the paper(know from the paper 'SemEval-2010 Task 5: Automatic Keyphrase Extraction from scientific articles' ).The document readme.md shows that the f1-score of WINGNUS is about 0.2 so what the candidate selection method is used to achieve this result.
Yuxia
from pke.
The candidate selection approaches in Kea and Wingnus are different. In Kea, all n-grams are selected as candidates while in Wingnus only the simplex noun phrases are selected. This is what is performed if you use the default candidate_selection()
method for both models, and this is what I used for benchmarking the two methods.
I will commit an example of training/testing procedure in the repo asap.
f.
from pke.
Hi @boudinfl
I use the example code in issue 'How to set up a training set in a supervised method?' to test the given model kea-semeval2010.pickle and MINGNUS-semeval2010.pickle and I get the true result. Now I have a question whether the data format used must be 'corenlp' when training the model. Maybe that's the answer because I use the 'raw' data (.txt) to train the model.
yuxia
from pke.
I've included an example of training and testing procedure in the repo (examples/training_and_testing_a_kea_model), please have a look at it.
Also, please update to the latest version of pke
by running:
pip install -U git+https://github.com/boudinfl/pke.git
Concerning the format of the document, you can use raw data but you have to change the format
and extension
paramters accordingly in train_supervised_model()
.
f.
from pke.
Hi,
It is very kind of you that you could provide the examples of training and testing. However, I use the training example to train a mode with default code, it still has this problem. No gold references in the candidate keyphrases.
Here is my train procedure.
`
import os
import sys
import codecs
import logging
import pke
logging.basicConfig(level=logging.INFO)
input_dir = 'D:\program\pke-master\examples\semeval2010\train'
reference_file = "D:\program\pke-master\examples\semeval2010\trainanswer\train.combined.stem.final"
df_file = "D:\program\pke-master\pke\models\train-lvl-1-df.tsv"
logging.info('Loading df counts from {}'.format(df_file))
df_counts = pke.load_document_frequency_file(input_file=df_file,
delimiter='\t')
output_mdl = "Kea_result.pickle"
pke.train_supervised_model(input_dir=input_dir,
reference_file=reference_file,
model_file=output_mdl,
df=df_counts,
format="raw",
use_lemmas=False,
stemmer="porter",
model=pke.supervised.Kea(),
language='english',
extension="txt")`
After finishing training, there is a warning.
C:\Users\User0\Anaconda3\envs\python27\lib\site-packages\sklearn\naive_bayes.py:461: RuntimeWarning: divide by zero encountered in log
self.class_log_prior_ = (np.log(self.class_count_) -
I don't know what is wrong.
Yuxia
from pke.
The error comes from the scikit learn, can you send me an archive with your code/data so I can try to reproduce your issue?
Thanks
from pke.
Hi,
I have sent to your email but I don't know whether it is received by your email server.
Yuxia
from pke.
Related Issues (20)
- Langcode "ge" does not work with spacy HOT 2
- max_length parameter error with the latest version HOT 1
- Keyword dataset HOT 1
- How to manipulate length of key-phrases? HOT 3
- AttributeError: module 'scipy.sparse' has no attribute 'coo_array' HOT 1
- Throws zero division error HOT 3
- sklearn is deprecated, breaks PKE HOT 1
- error while installing pke HOT 1
- SnowballStemmer and Spacy-model use different langcodes HOT 1
- Error: module 'scipy.sparse' has no attribute 'coo_array' HOT 1
- KP-Miner: why candidate_df is 1 for n-grams except unigram? HOT 1
- Error in PositionRank: tuple index out of range HOT 1
- Error in TopicalPageRank: 'numpy.ndarray' object has no attribute 'index' HOT 3
- Does not support Chinese? HOT 1
- PositionRank algorithm fails with networkx version 3.0: IndexError in `candidate_weighting()` method HOT 1
- LookupError: Can't find any language named 'hinglish' HOT 1
- Memory leak in TopicRank HOT 5
- hinglish key error HOT 1
- extractor.load_document (Spacy) limitation of 1000000 characters
- TfIdf still state of the art?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pke.