Comments (3)
I figured out a way to only check for coreference in a sentence, although it seems a bit hacky. For example in:
[Carol: [Carol, she]]
I first calculated the begin index and the end index of the sentence in question. Then, I checked to see if the index of the first mention (Carol) was in between the begin index and end index.
If it was, then it was a valid coreference within a sentence. If it was not, then it was a coreference from another sentence.
Is there a better approach than this?
from neuralcoref.
Well the behavior in your first comment is intended:
- if you ask for the coreference of a Doc, you get all the coreferences.
- if you ask for the coreference of a Span you only get coreferences that matches exactly the Span.
This is required to navigate easily within the chains. I understand it may be a bit surprising, I will try to clarify it a bit in the readme.
Regarding your second comment, another way to limit coreference to single sentences only would be to split your string in sentences (like string.split('.')
) and feed a list of strings instead of a single string to the nlp
object.
from neuralcoref.
Ah I see, thank you for the clarification. We're relying on user input that may put in decimal numbers, abbreviations, etc. that would mess up the split string method. I tried first passing the whole paragraph through nlp
and then passing each sentence in doc.sents through nlp
, although I found that performance was too slow for our requirements
A coreference option within a sentence could be a useful feature for the future. Until then, the workaround I made above works (if a bit hacky) for anyone looking to do this
from neuralcoref.
Related Issues (20)
- Wrong average embedding during inference due to a small bug in neuracoref.pyx
- Missing implementation of doc embeddings during inference
- Wrong Mention Type one-hot vectors during training due to a small bug in dataset.py
- Training Dataset Format
- Can't install neuralcoref, keep getting this error: C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 HOT 4
- Error in training without changing anything from the default instructions
- GPU support - cuda 11.1 - TypeError: Unsupported type <class 'numpy.ndarray'>
- (base) C:\Users\sk136\neuralcoref>python -m neuralcoref.train.learn --train ./data/train/ --eval ./data/dev/ facing problem while executing.. this command
- Results completely differ from web-demo
- Compatibility with Spacy 3+ HOT 7
- Regarding finetuning neuralcoref
- dels HOT 1
- neuralcoref not supporting python 3.9 version HOT 1
- spacy.strings.StringStore size changed, may indicate binary incompatibility HOT 5
- Dependency Problem HOT 1
- I can't install neuralcoref HOT 7
- Unresolved dependencies?
- Kernel crashes when trying to run demo code HOT 1
- Process finished with exit code -1073741819 (0xC0000005)
- installation failed with HOT 3
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 neuralcoref.