Skip to content

Commit 2ef48bc

Browse files
authored
bing_id -> bing_entity_search_api_id (#13491)
1 parent a9956d2 commit 2ef48bc

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pass in `v3.0` to the kwarg `api_version` when creating your TextAnalyticsClient
1212
- `offset` is the offset of the text from the start of the document
1313
- We now have added support for opinion mining. To use this feature, you need to make sure you are using the service's
1414
v3.1-preview.1 API. To get this support pass `show_opinion_mining` as True when calling the `analyze_sentiment` endpoint
15-
- Add property `bing_id` to the `LinkedEntity` class. This property is only available for v3.1-preview.2 and up, and it is to be
15+
- Add property `bing_entity_search_api_id` to the `LinkedEntity` class. This property is only available for v3.1-preview.2 and up, and it is to be
1616
used in conjunction with the Bing Entity Search API to fetch additional relevant information about the returned entity.
1717

1818
## 5.0.0 (2020-07-27)

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -630,11 +630,11 @@ class LinkedEntity(DictMixin):
630630
:ivar data_source: Data source used to extract entity linking,
631631
such as Wiki/Bing etc.
632632
:vartype data_source: str
633-
:ivar str bing_id: Bing unique identifier of the recognized entity. Use in conjunction
633+
:ivar str bing_entity_search_api_id: Bing unique identifier of the recognized entity. Use in conjunction
634634
with the Bing Entity Search SDK to fetch additional relevant information. Only
635635
available for API version v3.1-preview.2 and up.
636636
.. versionadded:: v3.1-preview.2
637-
The *bing_id* property.
637+
The *bing_entity_search_api_id* property.
638638
"""
639639

640640
def __init__(self, **kwargs):
@@ -644,31 +644,31 @@ def __init__(self, **kwargs):
644644
self.data_source_entity_id = kwargs.get("data_source_entity_id", None)
645645
self.url = kwargs.get("url", None)
646646
self.data_source = kwargs.get("data_source", None)
647-
self.bing_id = kwargs.get("bing_id", None)
647+
self.bing_entity_search_api_id = kwargs.get("bing_entity_search_api_id", None)
648648

649649
@classmethod
650650
def _from_generated(cls, entity):
651-
bing_id = entity.bing_id if hasattr(entity, "bing_id") else None
651+
bing_entity_search_api_id = entity.bing_id if hasattr(entity, "bing_id") else None
652652
return cls(
653653
name=entity.name,
654654
matches=[LinkedEntityMatch._from_generated(e) for e in entity.matches], # pylint: disable=protected-access
655655
language=entity.language,
656656
data_source_entity_id=entity.id,
657657
url=entity.url,
658658
data_source=entity.data_source,
659-
bing_id=bing_id,
659+
bing_entity_search_api_id=bing_entity_search_api_id,
660660
)
661661

662662
def __repr__(self):
663663
return "LinkedEntity(name={}, matches={}, language={}, data_source_entity_id={}, url={}, " \
664-
"data_source={}, bing_id={})".format(
664+
"data_source={}, bing_entity_search_api_id={})".format(
665665
self.name,
666666
repr(self.matches),
667667
self.language,
668668
self.data_source_entity_id,
669669
self.url,
670670
self.data_source,
671-
self.bing_id,
671+
self.bing_entity_search_api_id,
672672
)[:1024]
673673

674674

sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -599,4 +599,4 @@ def test_bing_id(self, client):
599599
result = client.recognize_linked_entities(["Microsoft was founded by Bill Gates and Paul Allen"])
600600
for doc in result:
601601
for entity in doc.entities:
602-
assert entity.bing_id # this checks if it's None and if it's empty
602+
assert entity.bing_entity_search_api_id # this checks if it's None and if it's empty

sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_linked_entities_async.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ async def test_bing_id(self, client):
635635
result = await client.recognize_linked_entities(["Microsoft was founded by Bill Gates and Paul Allen"])
636636
for doc in result:
637637
for entity in doc.entities:
638-
assert entity.bing_id # this checks if it's None and if it's empty
638+
assert entity.bing_entity_search_api_id # this checks if it's None and if it's empty

sdk/textanalytics/azure-ai-textanalytics/tests/test_repr.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ def linked_entity(linked_entity_match):
117117
data_source_entity_id="Bill Gates",
118118
url="https://en.wikipedia.org/wiki/Bill_Gates",
119119
data_source="wikipedia",
120-
bing_id="12345678"
120+
bing_entity_search_api_id="12345678"
121121
)
122122
model_repr = (
123123
"LinkedEntity(name=Bill Gates, matches=[{}, {}], "\
124124
"language=English, data_source_entity_id=Bill Gates, "\
125-
"url=https://en.wikipedia.org/wiki/Bill_Gates, data_source=wikipedia, bing_id=12345678)".format(
125+
"url=https://en.wikipedia.org/wiki/Bill_Gates, data_source=wikipedia, bing_entity_search_api_id=12345678)".format(
126126
linked_entity_match[1], linked_entity_match[1]
127127
)
128128
)

0 commit comments

Comments
 (0)