Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running issue with collections package #10

Closed
immorBen opened this issue Apr 12, 2022 · 2 comments
Closed

running issue with collections package #10

immorBen opened this issue Apr 12, 2022 · 2 comments

Comments

@immorBen
Copy link

immorBen commented Apr 12, 2022

When running "test.test_classifier_single_paper()",

>>> import cso_classifier as test
>>> test.test_classifier_single_paper()

got the following messages:

De-anonymizing Social Networks
Operators of online social networks are increasingly sharing potentially sensitive information about users and their relationships with advertisers, application developers, and data-mining researchers. Privacy is typically protected by anonymization, i.e., removing names, addresses, etc. We present a framework for analyzing privacy and anonymity in social networks and develop a new re-identification algorithm targeting anonymized social-network graphs. To demonstrate its effectiveness on real-world networks, we show that a third of the users who can be verified to have accounts on both Twitter, a popular microblogging service, and Flickr, an online photo-sharing site, can be re-identified in the anonymous Twitter graph with only a 12% error rate. Our de-anonymization algorithm is based purely on the network topology, does not require creation of a large number of dummy "sybil" nodes, is robust to noise and all existing defenses, and works even when the overlap between the target network and the adversary's auxiliary information is small.
data mining, data privacy, graph theory, social networking (online)
Computer Science Ontology loaded.
Model loaded.
Traceback (most recent call last):
File "", line 1, in
File "[my-personal-path]python3.10/site-packages/cso_classifier/test.py", line 35, in test_classifier_single_paper
result = cso_classifier.run(paper)
File "[my-personal-path]/python3.10/site-packages/cso_classifier/classifier.py", line 80, in run
self.model = MODEL(use_full_model=self.use_full_model, silent = self.silent)
File "[my-personal-path]/python3.10/site-packages/cso_classifier/model.py", line 27, in _init_
self.load_models()
File "[my-personal-path]/python3.10/site-packages/cso_classifier/model.py", line 35, in load_models
self.__load_word2vec_model()
File "[my-personal-path]python3.10/site-packages/cso_classifier/model.py", line 167, in __load_word2vec_model
self.full_model = pickle.load(open(self.config.get_model_pickle_path(), "rb"))
File "[my-personal-path]/python3.10/site-packages/gensim/_init_.py", line 5, in
from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401
File "[my-personal-path]/python3.10/site-packages/gensim/corpora/_init_.py", line 12, in
from .dictionary import Dictionary # noqa:F401
File "[my-personal-path]/python3.10/site-packages/gensim/corpora/dictionary.py", line 11, in
from collections import Mapping, defaultdict
ImportError: cannot import name 'Mapping' from 'collections' ([my-personal-path]lib/python3.10/collections/_init_.py)

and "from collections.abc import Mapping" works well. @angelosalatino

If changing File "[my-personal-path]lib/python3.10/site-packages/gensim/corpora/dictionary.py", modify the import as "from collections.abc import Mapping", another importing error occurred:

ImportError: cannot import name 'Iterable' from 'collections' ([my-personal-path]/lib/python3.10/collections/_init_.py)

gensim/models/fasttext.py also uses "Iterable"...

details about my environment
os: ubuntu 18.04.6 LTS
versions:

  • conda: 4.12.0
  • python: 3.10.4
  • cso-classifier: 3.0
  • cso ontology: 3.3
@immorBen
Copy link
Author

A somewhat similar issue happened in Azure related issues, they suggested modifying "import Mapping/Iterable from collections.abc" in related scripts.

@immorBen immorBen changed the title running issue with collection package running issue with collections package Apr 12, 2022
@immorBen
Copy link
Author

As reflected somewhere else, this import error is along with python 3.10. Re-install with python 3.8.8 can figure out this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant