Downloads · 30 days
9
1% of all-time downloads
flexudy/t5-base-conceptor
t5-base-conceptor is a machine learning model from flexudy. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
9
1% of all-time downloads
All-time downloads
1.4K
Public
Repo size
1.8 GB
Likes
4
Public
Click a slice to open those files.
.bin892 MB · 100%
From the Hugging Face model README

At Flexudy, we look for ways to unify symbolic and sub-symbolic methods to improve model interpretation and inference.
It would be cool if my neural network would just know that cat is an animal right? ∀x.Cat(x) ⇒ Animal(x). Or for example, (∀x.SchöneBlumen(x) ⇒ Blumen(x)) -- English meaning: For all x, If x is a beautiful flower, then x is still a flower. --
All of a sudden, tasks like Question Answering, Summarization, Named Entity Recognition or even Intent Classification etc become easier right?
Well, one might probably still need time to build a good and robust solution that is not as large as GPT3.
Like Peter Gärdenfors, author of conceptual spaces, we are trying to find ways to navigate between the symbolic and the sub-symbolic by thinking in concepts.
Should such a solution exist, one could easily leverage true logical reasoning engines on natural language.
How awesome would that be? 💡
No library should anyone suffer. Especially not if it is built on top of 🤗 HF Transformers.
Go to the Github repo
pip install git+https://github.com/flexudy/[email protected]
from flexudy.conceptor.start import FlexudyConceptInferenceMachineFactory
# Load me only once
concept_inference_machine = FlexudyConceptInferenceMachineFactory.get_concept_inference_machine()
# A list of terms.
terms = ["cat", "dog", "economics and sociology", "public company"]
# If you don't pass the language, a language detector will attempt to predict it for you
# If any error occurs, the language defaults to English.
language = "en"
# Predict concepts
# You can also pass the batch_size=2 and the beam_size=4
concepts = concept_inference_machine.infer_concepts(terms, language=language)
Output:
{'cat': ['mammal', 'animal'], 'dog': ['hound', 'animal'], 'economics and sociology': ['both fields of study'], 'public company': ['company']}
2 to 4 concepts at random for each term. This means, there is still great potential to make the models generalise better 🚀.279884 training examples and 1260 for testing. Edges -- i.e IsA(concept u, concept v) -- in both sets are disjoint.15K steps with learning rate linear decay during each step. Starting at 0.001RAdam Optimiser with weight_decay =0.01 and batch_size =36.64.| Metric | Score |
|---|---|
| Exact Match | 36.67 |
| F1 | 43.08 |
| Loss smooth | 1.214 |
Unfortunately, we no longer have the metrics for flexudy-conceptor-t5-small. If I recall correctly, base was just slightly better on the test set (ca. 2% F1).
Conceptnet is very large. Even if you just consider loading a fragment into your RAM, say with only 100K edges, this is still a large graph.
Especially, if you think about how you will save the node embeddings efficiently for querying.
If you prefer this approach, Milvus can be of great help.
You can compute query embeddings and try to find the best match. From there (after matching), you can navigate through the graph at 100% precision.