Comments (3)
Hi @tunde99, amazing work, thank you so much for doing that! I'll have a deeper look into your edits and merge it in the next few days.
from responsibly.
I am getting the same error on Mac M1 Ventura running Python 3.10 in a fresh conda environment. Bradley's screenshot does not contain the error message he mentioned in his comment, so here is a full traceback of the gensim error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[2], line 1
----> 1 from responsibly.dataset import COMPASDataset
File ~/anaconda3/envs/seldo_responsibly/lib/python3.10/site-packages/responsibly/__init__.py:3
1 # pylint: disable=line-too-long
----> 3 from responsibly import fairness, we
6 __project__ = 'responsibly'
7 __description__ = 'Toolkit for Auditing and Mitigating Bias and Fairness of Machine Learning Systems 🔎🤖🧰'
File ~/anaconda3/envs/seldo_responsibly/lib/python3.10/site-packages/responsibly/we/__init__.py:48
1 """
2 Metrics and debiasing for bias (such as gender and race) in word embedding.
3
(...)
45
46 """
---> 48 from responsibly.we.bias import BiasWordEmbedding, GenderBiasWE
49 from responsibly.we.data import load_w2v_small
50 from responsibly.we.utils import most_similar
File ~/anaconda3/envs/seldo_responsibly/lib/python3.10/site-packages/responsibly/we/bias.py:93
91 from responsibly.we.benchmark import evaluate_word_embedding
92 from responsibly.we.data import BOLUKBASI_DATA, OCCUPATION_FEMALE_PRECENTAGE
---> 93 from responsibly.we.utils import (
94 assert_gensim_keyed_vectors, cosine_similarity, generate_one_word_forms,
95 generate_words_forms, get_seed_vector, most_similar, normalize,
96 plot_clustering_as_classification, project_params, project_reject_vector,
97 project_vector, reject_vector, round_to_extreme,
98 take_two_sides_extreme_sorted, update_word_vector,
99 )
102 DIRECTION_METHODS = ['single', 'sum', 'pca']
103 DEBIAS_METHODS = ['neutralize', 'hard', 'soft']
File ~/anaconda3/envs/seldo_responsibly/lib/python3.10/site-packages/responsibly/we/utils.py:14
9 from sklearn.manifold import TSNE
10 from sklearn.metrics import accuracy_score
13 WORD_EMBEDDING_MODEL_TYPES = (gensim.models.keyedvectors.KeyedVectors,
---> 14 gensim.models.keyedvectors.BaseKeyedVectors,
15 gensim.models.fasttext.FastText,
16 gensim.models.word2vec.Word2Vec,
17 gensim.models.base_any2vec.BaseWordEmbeddingsModel,) # pylint: disable=line-too-long
20 def round_to_extreme(value, digits=2):
21 place = 10**digits
AttributeError: module 'gensim.models.keyedvectors' has no attribute 'BaseKeyedVectors'
from responsibly.
I forked the repo and made some edits to the gensim functions in the utils.py
and bias.py
files in the responsibly.we
directory to work for my use case. You might want to skip pip installation for now and follow the direct source code installation guideline in the README file and clone my repo https://github.com/tunde99/responsibly.git
instead to see if it works for you too. I should probably make a pull request.
from responsibly.
Related Issues (7)
- Add score with pandas groupby
- Refactor roc_curve_by_attr to use one thresholds for all the sensitive attribute values
- Fix description in PyPI HOT 1
- Document the preprocessing for each dataset (in the docstring)
- Support in multi-values for the sensitive attribute
- Bias mitigation and fairness boosting in multi class classification use case HOT 2
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 responsibly.